Course Links

Exercises

Resources

External

Java is already installed on aurora and the lab machines available in class. Thus one option that is always available is to connect to aurora remotely using SSH or PuTTY, edit your programs in emacs, and compile using the command-line tools. However, the editing interface through this sort of connection is somewhat limited because mouse input is disabled, and you cannot properly test programs that open up their own windows. Thus you may wish to install Java on your own computer, do your development there, and only transfer the files to aurora when it is time to submit them.

You can install Java on your own laptop or desktop machine, and use it to compile and run programs just as you would on one of the lab machines. There are several ways to accomplish this, depending on what operating system you are using and what kind of environment you prefer to work in. Below are several of the major alternatives. (In case anyone is curious, my own computers are Windows configured with Cygwin and emacs, as detailed below.)

Installing an IDE

An IDE, or integrated development environment, is a program that supports software development, particularly for large or complex projects. It typically includes an editor where code can be written, and an integrated system that will compile and run the program when it is ready. It may also offer other services such as code highlighting, identification of errors, etc.

A number of good IDE's are available free for Java programming. Consider installing Eclipse. Alternately, you might try NetBeans, IntelliJ, or Dr. Java. Each has its own strengths and quirks. Exploring these programs fully is beyond the scope of the course, but they each have online documentation and should be fairly simple to use for the projects we will encounter in this course. Remember that when your program is finished you will still have to transfer the source files to aurora in order to submit them, and it is probably a good idea to test that they compile properly there using the regular command-line tools.

Direct Installation

The other option is to install the Java SDK (software development kit) separately, and use an editor program and command line tools to develop and compile. This approach is more like the way one would develop a program on aurora, except that the action will take place on your own computer. You can use this approach with any modern operating system, although getting it installed is easier on some than others. (For what it is worth, I currently use this method with Windows, including a native Windows Emacs application.) If you are using Linux or Mac, all the necessary software may already come preinstalled for you.

First you need the Java SDK. Go to Sun's download page and get the latest version for your computer. Install it as you would any other program on your system.

On Linux and Mac, that should be all you need to do. Mac users can open a Unix-like command window using the Terminal program, and issue compiler commands there. On Windows, you can either use the default command window or install the CygWin package, which provides a more Unix-like interface and set of tools. In either case on Windows, to compile and run programs from a command line you may need to edit your system's path variable to add the directory where the java binaries are stores. For example, on Windows, they install by default into C:\Program Files\Java\jdk1.5.0_06\bin. Open the System control panel, and under the Advanced tab select the Environment variables button. You should see Path in the System Variables section. Edit its value, and add C:\Program Files\Java\jdk1.5.0_06\bin; at the beginning.

If you want a unix-like shell and emacs on Windows, read this. Some people have reported trouble with cygwin not being able to find the java programs even after setting up the path as described above. The problem seems to be that cygwin is looking in a particular place for java files regardless of what the path says. If this seems to be the case, one solution is to make a symbolic link from the default location to the actual location.

ln -s /cygdrive/c/Program\ Files/Java/jdk1.7.0_11/bin/java /cygdrive/c/Windows/system32/java