Install Java
Home Up Install C++ Install Java Install NetBeans

 

Sample Application

Installing Java

Install the Java Virtual Machine (JVM)

bulletNavigate to http://java.sun.com/javase/downloads/
bulletFind the Installation Instructions for the latest JDK update (currently JDK 6 update 6; NOT the "with J2EE" NOR the “with NetBeans” download)
bulletRead the Installation Instructions for your Operating System
bulletReturn to the download page and click the “Download” button for the JDK update.
bulletAccept the License Agreement
bulletThen download the latest Java SE Development Kit for your operating system (for Windows, I recommend the "Windows Offline Installation")
bulletRun the installation program an follow the onscreen default options. Note the installation directory for the J2SE.
 

Set the environment variables (Windows 2000, XP and Vista).

bulletClick the “Start” button
bulletOpen the “Control Panel” (“Settings >> Control Panel” in Windows 2000)
bulletSelect “System” to open up the “System Properties”
bulletSelect the “Advanced” tab
bulletClick the “Environment Variables…” button
bulletCreate or Update the “JAVA_HOME” variable
bulletIn the “System Variables (lower screen), select the “JAVA_HOME” variable if it exists and click “Edit”. If “JAVA_HOME” does NOT exist, click “New” and type “JAVA_HOME” (all uppercase with underscore between words) in the “Variable Name” field.
bulletIn the “Variable Value” field, replace the existing value (if any) or add the installation directory where Java was installed (i.e., “C:\Program Files\Java\jdk1.6.0_06”).
bulletClick “OK”
bulletUpdate the “PATH” variable
bulletIn the “System Variables (lower screen), select the “PATH” variable and click “Edit”.
bulletClick on the “Variable Value” field and press the “Home” key (this positions the cursor at the beginning of the field).
bulletInsert “%JAVA_HOME%\bin;” in the “Variable Value” field being careful NOT to overwrite any existing text. Type it exactly as quoted and don’t forget the semicolon after “bin”
bulletClick “OK”
bullet Create or Update the “CLASSPATH” variable
bulletIn the “System Variables” (lower screen), select the “CLASSPATH” variable if it exists and click “Edit”. If “CLASSPATH” does NOT exist, click “New” and type “CLASSPATH” (all uppercase with no spaces) in the “Variable Name” field.
bulletIf there is an existing “CLASSPATH” value, click on the “Variable Value” field and press the “Home” key (this positions the cursor at the beginning of the field).
bulletInsert “.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar” in the “Variable Value” field being careful NOT to overwrite any existing text. Type it exactly as quoted. Notice the “.;” (dot semicolon) at the beginning and don’t forget the semicolon after “dt.jar”.
bulletIf there is text after “tools.jar”, add a semicolon after “tools.jar”
bulletClick “OK”

For MACs, Linux or Unix, define and export the environment variables specified above.

 

Command line test the compiler and the interpreter.

bulletClick the “Start” button
bulletSelect “Run”
bulletIn the “Open” field, type “cmd” and click “OK”.
bulletType "echo %PATH%" in the command window
bulletDepending on your installation directory, you should see something like:

"C:\Program Files\Java\jdk1.6.0_06\bin;" at the beginning of the PATH statement

 

bulletType "echo %CLASSPATH%" in the command window
bulletDepending on your installation directory, you should see something like:

”.;C:\Program Files\Java\jdk1.6.0_06\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_06\lib\tools.jar;” at the beginning of the CLASSPATH.

 

bulletAt the command line, type “java -version"
bulletYou should see: java version "1.6.0_06" at the beginning of the display.
bulletAt the command line, type "javac -version"
bulletYou should see: javac 1.6.0_06 at the beginning of the display.
 

Trouble?

Open a command line window and type:

set > set.txt
This will create a file in your current directory called “set.txt” that contains the values of your environment variables. Send an email message including your evening phone number to jfleming@troy.edu and give me a “stepbystep” description of what your are doing and any messages or other symptoms about what's wrong. Attach screen shots, if available, and attach the “set.txt” file. I’ll call you back as soon as possible (usually that evening).