directions for perl programming setup in cps160
In this class we will be using a common IDE (Integrated Development Environment) called Eclipse. IDEs are nice because they often make programming easier with features such as syntax highlighting and debugging capabilities. This is especially useful for Perl, which can sometimes be syntactically fickle.
Eclipse was developed in Java, so in addition to Eclipse, you will also need to download the JRE (Java Runtime Environment) from Sun. This allows Eclipse to be run on almost any OS, from Windows to Mac and UNIX. Note, the Mac OS comes preloaded with the JRE, so you will most likely not need to download anything if you are using a Mac. Also, if you have programmed in Java before, you almost certainly have the JRE installed. The JRE can be found here (7.6 MB). You can download the Java SDK (Software Developers Kit) instead. If you plan on coding anything in Java later, or if you plan on taking another Computer Science class at Duke, I would recommend you download the SDK instead. In addition to the JRE, it includes libraries which may be necessary for any Java coding projects you take on. These steps are listed below.
1.) Download the JRE or Java SDK 1.4.2_06 for your operating system (if it is not already installed). Click the "Download J2SE SDK" link, and you will have to accept a license agreement. Then, select the appropriate Java SDK for your OS.
- Windows (51.6 MB). Self-installing application.
- Macintosh (already installed with Mac OS X). However, if you want, you can update to version 1.4.2 (26 MB).
- Linux (34.6 MB). Self-installing application.
Once you have downloaded and installed either the JRE or the Java SDK, you need to actually download Eclipse. The Eclipse file you download is not a self-installing archive. Instead, you will need to extract the zip file's contents to a folder on your hard-drive (you can just use C:\ or C:\Program Files). These steps are listed below.
2.) Download Eclipse 3.0.1 for your operating system:
- Windows (85.4 MB). Unzip into your Program Files folder.
- Macintosh (80.8 MB). Unstuff into your Applications folder.
- Linux (85.1 MB). Unzip into /usr/local directory.
3.) For convenience, you will most likely want a short-cut to Eclipse on your desktop. In windows, this is fairly simple to do. Right click on the desktop and select new shortcut. Then type C:\eclipse\eclipse.exe or C:\Program Files\eclipse\eclipse.exe depending upon where you extracted the files to. For Macs, this process is slightly different, but I can help you on Monday if you are having problems.
Now that you have Eclipse installed, you will need to install the libraries that are necessary to run Perl. Once again, these come preinstalled in UNIX and thus in any Mac OS. One of the most popular libraries for this is ActivePerl. The current version is 5.8.6. These steps are listed below.
4.) Download and install ActivePerl:
- Windows (12.6 MB). Self-installing application.
- Macintosh (already installed with Mac OS).
- Linux (15.0 MB). Unzip into /usr/local directory.
5.) Next, you need to install the Ambient plug-in. The Ambient plug-in provides a simple interface for you to send receive and submit code. Run Eclipse and use its update manager to download and install the Ambient plugin by following the directions online.
6.) You also need to install and set up the EPIC plug-in. This will allow you to create and run Perl programs from within Eclipse. These steps are similar to those found at the link above. Follow the instructions below:
- Open Eclipse and access the Help menu.
- Select Software Updates > Find and Install.
- Select Search for new features to install and click Next.
- Type http://e-p-i-c.sf.net/updates/testing as a New Remote Site.
- Select the update site you just created and click Next.
- Select the EPIC feature and click Finish.
- Follow the next few easy steps to finish the installation.
- It is recommended to restart the Eclipse workbench in order for the changes to take place.
7.) Finally, you need to set up Eclipse so that you can run your Perl programs with a simple click. This will allow you to bring up the shell or command prompt in the console.
- Select Run > External Tools... > External Tools...
- In the window that pops up, select Program and click New.
- You can leave the name the same, but in the Location field, type C:\WINDOWS\system32\cmd.exe (this will be C:\WINNT\system32\cmd.exe instead if you are using Windows 2000 or upgraded from Windows 2000, and /bin/tcsh for Macs or Linux).
- In the Working Directory field, type ${project_loc}.
- Leave the Arguments field blank if using Windows, but place a -i in the field if you are using a Macintosh or Linux.
- Click the Common tab, and ensure that the checkbox under "Display in favorites menu" is checked and that the "Launch in background" checkbox is also checked.
- Click Apply then close.
Next, try making your first perl program in Eclipse.