The Win7 is configured with two JDK, the jdk1.6 is installed, and the project requires 1.8.
First, go to Oracle's website and download a JDK that matches your version of Eclipse (my 32-bit).
Website: https://www.oracle.com/index.html
Install after download.
Then modify the environment variables for the JDK: Java_home is the installation path for the newly installed jdk1.8.
cmd command input: java-version Enter to see if the installation configuration was successful.
------------------------------------------------------------------------------
Above, a new JDK is installed successfully, although the computer can install multiple JDK, but use only one, because to configure the JDK environment variable, its value can only configure one, or configure multiple semicolon separated, but only read the last JDK path.
Now that the computer is configured with JDK 1.8, if you want to use jdk1.6, you will need to modify the environment variable back to the jdk1.6 installation path.
But when I first modified the environment variable path, I found that the computer configuration was any 1.8, indicating that modifying only the environment variables did not work.
Online Search found: when the installation of JDK1.6 (the machine first installed jdk1.6 and then installed jdk1.8), automatically java.exe, Javaw.exe, javaws.exe three executables copied to the C:\Windows\ System32 directory, because this directory takes precedence over environment variables set by Java_home in Windows environment variables
Delete these three files, execute java-version again, and find that the JDK was successfully converted to 1.6.
There are also cases where copying files to the C:\ProgramData\Oracle\Java\javapath directory depends on your situation.
Here if the above two directories do not find the three files, you can first jdk1.8 jre/bin (note not jdk/jre/bin) directory of the three files cut to another place, cmd execution java-version will prompt ... Directory is not found, this directory is to store your boot JDK shortcut file (in fact, Java.exe, Javaw.exe, javaws.exe three files shortcuts), the directory of three files deleted, or cut to other places, to perform java-version, The JDK has been replaced with 1.6.
---------------------------------------------------------------------------
The next time you want to switch the JDK version again, you can modify the environment variable java_home directly.
Turn from:
http://blog.csdn.net/wangww3/article/details/52606911
Windows7 installation of two JDK configurations