Windows7 system, JDK environment variable configuration problem

Source: Internet
Author: User

Troubled a few days of problems, and today finally solved the!!!!!!!!!! At this moment is moving in the!!!!! Thanks to the online big God hair posts, in order to thank them, I share my experience as follows ...

1, on the official website next to the latest version of the JDK installed at the prompt, can be installed on any disk, not necessary and not recommended to install on the C drive

2, enter the environment variable setting method: "Computer" right "properties"--"Advanced system Settings"--"advanced"-"Environment variables" Open the Environment Variable Settings window.

3. In the "System Environment variables" Setting window below, click "New" to create the Java_home variable:

Variable name: java_home

Variable Value: F:\java\JDK (your JDK installation directory)

3. In the "System Environment variables" Setting window below, click "New" to create the CLASSPATH variable:

Variable name: CLASSPATH

Variable value: F:\java\JDK\lib\dt.jar; F:\java\JDK\lib\tools.jar; (Note semicolon)

4, in the following "System environment variables" setting window, double-click the "PATH" variable, after the value of the variable to add F:\java\JDK\bin; (Note semicolon)

5, in "Run" input cmd, enter, open the Command window, enter Javac, a variety of information that shows that the installation configuration is correct.

If the prompt "Javac is not an internal command or external command, is not a running program or batch file" but the input java-version can display the JDK version number correctly, then the effort ...

6. Solution:

Run-->cmd

Run the following command in the console to set the Java environment variable to resolve:

Set JAVA_HOME=F:\JAVA\JDK (Install the root directory of the JDK)

Set Classpath=%java_home%\lib\tools.jar;%java_home%\lib\dt.jar;

Set Path=%java_home%\bin;

7, complete the above steps in the cmd input javac, if there is a variety of information indicating that the configuration is successful, if the "cannot find or load the main class Com.sun.tools.javac.Main" prompt, then you can not find Javac life

So, I deleted the installed JDK, and after reloading, it succeeded!!!!!!!!!!!!

Unfortunately, all of the above problems I encountered in the installation, fortunately, under the guidance of netizens, I successfully solve all the problems!!!!!!! Learning is to constantly encounter problems, and constantly solve problems!!!!!!!!!!

After the biography,, OK, I have a problem again, input javac is able to display the information correctly, you can enter Java or java-version and can not display information!!

Solution: 1. regedit command to open the registry.

2. Find HKEY_LOCAL_MACHINE \ software \ javasoft \ Java Runtime environment \ 1.7 \ This registry

Modify Javahome=d:\jdk\jre

Modify Runtimelib=d:\jdk\jre\bin\client\jvm.dll

OK, in the input Java or java-version or Javac command, can display the correct information!!!! Problem SOLVING!!!!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.