Wednesday, June 15, 2011

How to configure Java environment variable in Windows

1. Install Java SDK and JRE first. All of them are be downloaded from java.com. After that, get the install path. Like: C:\Program Files (x86)\Java\jdk1.6.0_25. This folder will include bin, jre, lib and other folders
2. Click Start -> Right click Computer -> click Properties
3. Click the Advanced system settings from the left in the System explorer.
4. Click the Environment Variables from the Advanced tab in the System Properties dialog.
5. In the Environment Variables dialog, click the New... button to create a new variable
6. Refer the following table to create three variables. Note: The ",;" in classpath cannot be missed. If there is a path already exist, click edit button and then use ";" to separate items.
VariableValue
Java_Home C:\Program Files (x86)\Java\jdk1.6.0_25
Classpath .;%Java_Home%\lib
Path %Java_Home%\bin
7.Open a command, type "Java -version", "Java", "Javac" to test your environment

No comments:

Post a Comment