Three Java environment variables to be configured for Eclipse installation, and the eclipse Environment Variables
My computer → properties → advanced system settings → advanced → Environment Variables
1. JAVA_HOME: JDK installation path
2. PATH: % JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin;
3. CLASSPATH:.; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar;
Do I need to configure the Java environment variable for this installation?
If MyEclipse is used as a development tool, environment variables do not need to be configured. myeclipse will automatically find jdk installation configuration, in myeclipse, you can also configure the corresponding jdk and jre as needed, but generally it is automatically configured as what you install
If you do not need development tools such as myeclipse, environment variables will be used. For example, if you want to configure a command prompt, there is a positive solution upstairs, but you do not need to configure it. If you want to configure it, you only need path, and classpath, while java_home is set for later jdk changes. I have consulted a lecturer.
How to configure the environment variables to be configured if you want to run eclipse or compile a java file?
Configure environment variables: Right-click "my computer" --> "advanced" --> "environment variables"
Variable name: JAVA_HOME
Variable value: C: \ Program Files \ Java \ jdk1.6.0 _ 10
Click New again:
Variable name: classpath
Variable value:.; % JAVA_HOME % \ lib \ tools. jar
And add it to the path (do not delete the original ones); C: \ Program Files \ Java \ jdk1.6.0 _ 10 \ bin
Then execute the javac command at the command prompt to see if it can be run.
4. "Start" --> "run" --> Enter "javac" --> "Enter". If yes, the configuration is successful!
(Here C: \ Program Files \ Java \ jdk1.6.0 _ 10 refers to the installation directory path of your JDK installation. You can modify it based on the drive letter you installed)