Setting Java JDK environment variables in Winxp
: JDK 6.0 Java Development Kit Development environment package
Install and configure j2sdk:
Run the j2sdk installation program and customize the path. My installation path is: C: \ j2sdk1.4.2 _ 04
Configure j2sdk: Configure environment variables:
Choose my computer> Properties> advanced> environment variables> system variables to add the following environment variables:
JAVA_HOME = C: \ j2sdk1.4.2 _ 04
CLASSPATH =.; C: \ j2sdk1.4.2 _ 04 \ lib \ tools. jar; C: \ j2sdk1.4.2 _ 04 \ lib \ dt. jar; C: \ j2sdk1.4.2 _ 04 \ bin;
Path = C: \ j2sdk1.4.2 _ 04 \ bin;
Write a simple java program to test whether J2SDK has been installed successfully:
Public class hello
{
Public static void main (String args [])
{
System. out. println ("Hello ");
}
}
Save the program as a file named hello. java.
Open the Command Prompt window, go to the directory where hello. java is located, and type the following command
Javac hello. java
Java hello
If "hello" is printed, the installation is successful. If "hello" is not printed, check whether the preceding configuration is correct.
Note that "Hide extensions of known file types" is not checked in the system folder option (my computer> Tools> View)