First, you need the Java Development Kit (JDK) from Oracle. This is the actual compiler that your development environment (IDE) uses behind the scenes. Even if you already have Java installed, you probably still need this. (Most people only have the Java Runtime Environment (JRE) installed, which allows you to run existing Java programs but not compile new ones.)
Direct your web browser to http://www.oracle.com/technetwork/java/javase/downloads/
Click the big "Java Download" button above where it says "Java Platform (JDK) 7u21", or any newer version if it's newer.
You probably want the "Windows x86" version, which should be around 89 MB. Save this file in a location you can remember.
Once downloaded, run the executable. Follow the prompts to install the JDK. You'll need administrator access.
Next, you'll need to set an environment variable so that the command prompt can find the java compiler. You can find instructions for editing the PATH here.
Once you've added Java's bin folder to the PATH environment variable, you can try the Compiler Check assignment to make sure you've done it right.
Good news! The JDK is usually installed by default on Macs, so just open up "Terminal" and try the Compiler Check assignment to make sure.
On Debian-based distros (such as Ubuntu), you should be able to open up a terminal and install the JDK like so:
[email protected]:~$ sudo apt-get install sun-java6-jdk
Then, just try the Compiler Check assignment to make sure everything worked.
Although you can create Java programs in any text editor and compile/run them from the command-line, most students are more comfortable with an Integrated Development Environment that handles these things for them.
There are several good ones, but the one I used to recommend no longer has a non-expiring free version, so I'm looking into Geany as a possible replacement.
Last updated 2013-01-24
©2013 Graham Mitchell
This assignment is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.