Setting up your programming environment at home for CS127


In this class, we will be using a combination of text editor and the command line java compiler, javac. You may use any text editor you like, but the official "supported" text editor for this class is NEdit. Our default OS will be Linux. You are free to install the proper tools on your own PC, but your programs MUST compile and run on the standard lab Linux setup.

The lab computers are already set up with all of the software that you will need to create, compile, and run your programs. The following is a brief tutorial for setting up a similar programming environment on your home computer.

Note that I cannot officially support any setups outside of the lab, although I will try to answer questions whenever possible.

Linux
Windows
Mac

Linux

You will need to install NEdit (or, alternately, use your favorite text editor like emacs or vi) and the Java SDK. We will be using version J2SE 1.4.2_01. Here is the link to the Downloads page for this release. It is important that you download the SDK (Software Development Kit), NOT the JRE (Java Runtime Environment)! (The SDK comes with the JRE; you will need the SDK to compile your programs.) Installation instructions are also linked on this page.

Make sure that you put the Java executables (javac and java) in your path. There are several ways to do this:

Assuming you have installed everything correctly, usage will be the same as it is for the lab computers.

Windows

It is recommended that you use Notepad (or whatever your favorite text editor is) to write your programs. Make sure that you save your files as text, but not with an automatic extension; otherwise, your class files will most likely be written to a file that ends in .txt.

Alternately, you can install NEdit for Windows, but the installation is a bit complicated. This page (scroll down a bit) has additional info if you want to attempt to install NEdit.

You will also need to install the Java SDK. Here is the link to the Downloads page for this release. It is important that you download the SDK (Software Development Kit), NOT the JRE (Java Runtime Environment)! (The SDK comes with the JRE; you will need the SDK to compile your programs.) Installation instructions are also linked on this page.

You will probably want to create a directory to store all of your Java programs, e.g. C:/JavaFiles.

To compile and run programs, open a Command Prompt window, and cd to the directory where your program file(s) live(s). Then type javac and/or java as described for the lab computers.

If you try to compile or run a Java program, and you get an error like NoClassDefFoundException or Can't find class, you may need to set your CLASSPATH environment variable (i.e., tell Java where to find your class files). This page explains how to set your classpath in Windows.

If you try to compile or run a Java program, and you get an error like javac: Command not found or java: Command not found, you need to set your execution path (PATH). To do so, go to Control Panel, select System, and find the button that says "environment variables". You should be able to find the PATH here and append the path to where Java is installed.

Mac

It is suggested that you use your favorite text editor on Mac to write your programs. Again, make sure that you do not automatically save your files with an extension, or else your programs will most likely save with a .txt extension. Also, make sure that your files save as plain text and not RTF.

There is a port of Nedit to OSX. Here (scroll down) are the details if you would like to install it on your own machine.

OSX already has the Java SDK installed, so everything should just work. If you are running Mac OS 9, download the MRJ SDK 2.2 from this page.

To compile and run programs, open a Command Prompt window, and cd to the directory where your program file(s) live(s). Assuming you have installed everything correctly, usage will be the same as it is for the lab computers.


CS 117 main page

Last update: 29 December, 2003