Installing And Configuring Java - Windows

From OpenIndivo Documentation Wiki

Jump to: navigation, search

As a user with Administrator privileges, run the downloaded Java JDK executable, accepting all defaults in accordance with the license terms if acceptable. If you alter the default installation directory, remember the location, it will be needed at a later point in the installation.

Once installation is complete, follow these steps for creating and modifying the Windows environment variables. (You will create a JAVA_HOME environment variable and update the Windows path to enable the Java compiler and related tools to operate from any directory location within a command shell.)

Right-click on the My Computer on the desktop, and select the Properties menu item.

Selecting Properties context menu from desktop
Enlarge
Selecting Properties context menu from desktop

Select the “Advanced” tab and click on the “Environment Variables” button.

System Properties window
Enlarge
System Properties window

Click on the “New” button in the User variables section and add a variable named JAVA_HOME, with a value of the top level directory of where the Java Development Kit was installed. Press the “OK” button to save.

Setting the JAVA_HOME environment variable
Enlarge
Setting the JAVA_HOME environment variable

Next, highlight the Path variable in the System variables section of this screen and press the “Edit” button. The following screen will be displayed:

Setting the path to include the content of the Java binaries directory
Enlarge
Setting the path to include the content of the Java binaries directory

At the end of the variable value displayed for the "Path" variable name, append a semi-colon (“;”) and then add the full path of the 'bin' subdirectory in your JDK directory. For example, if the PATH value currently looks like this...

 PATH=C:\windows\system32;

...then, appending the full path of your JDK's 'bin' subdirectory would look something like this...

 PATH=C:\windows\system32;c:\Program Files\Java\jdk1.5.0_09\bin;

Then press the “OK” button on the Edit System Variable window and then press the “OK” button on the System Properties windows.

From the Windows “Start” button on the menu, select the “Run...” menu item. Into the dialog box, enter the command 'cmd' and press the “Ok” button. This will open a command window with a shell prompt

Opening a command window
Enlarge
Opening a command window

At the prompt, enter the command

javac –version

The following result should be displayed:

Confirm Java compiler is accessible from the command prompt
Enlarge
Confirm Java compiler is accessible from the command prompt

This confirms that the Java compiler has been installed correctly and is accessible from any directory within the command shell.

Personal tools