The examples in this article share with you the Java environment variable setting method for your reference. The specific content is as follows: After installing jdk, find my computer (right-click) -> Properties -> Advanced tab -> Environment variables , which contain the administrator's user variables and system variables. It doesn't matter which one I choose. I chose Administrator's user variable, that is, the administrator's user variable. Click "New". Below are three environment variables that need to be filled in. The forms are all environment name = environment value , just fill in in:
JAVA_HOME=c:/j2sdk1.5.0 (jdk installation folder location)
classpath=.;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar;(.; Must not be missing, because it represents the current path)
path=%JAVA_HOME%/bin
Then you can write a simple java program to test whether the JDK has been installed successfully:
public class Test{ public static void main(String args[]){ System.out.println("This is a test program."); }} Save the above program as a file with the file name Test.java.
Then open the command prompt window, cd to the directory where your Test.java is located, and then type the following command:
javac Test.java
java test
If you see this is a test program printed at this time, it means that the installation has been successful. If this sentence is not printed, you need to carefully check the configuration status.
The above is all the content of Java environment variable configuration. I hope it will be helpful to everyone's learning, and I hope everyone will support Wulin.com more.