The transfer from: http://blog.csdn.net/u010011371/article/details/50749954
Very good piece of article, suitable for my this small white, convenient later use.
have been using the JDK1.8 version, now to replace the JDK1.7! See a lot of online do not know how to switch. So write it up for everyone to share!
I now have JDK1.7 and JDK1.8 installed on my computer. The next step is to configure the environment variables!
Path configuration
%java_home%\bin;%java_home%\jre\bin;
Java_home Configuration
C:\Program files\java\jdk1.8.0_66
Classpath configuration
.; %java_home%\lib;%java_home%\lib\tools.jar
Java commands
Java-version
Results:
To switch to JDK1.4 below, only the environment variable is required.
Change the JDK version mode: (example 1.4) Step one: Write the java_home variable to the current JDK1.7 path. C:\Program files\java\jdk1.4.2 Step Two: Write JDK1.4 in the path variable to the bin path, (written in front)------> actually here I tried, the request is not very strict, you can test your own C : \program Files\java\jre\bin (This is your own installation of the JRE location, full path OH.) It can be added directly to the path variable before it can be used. Pro-Test effective)
That way, we're going to switch the JDK! You don't have to uninstall the original JDK. If you want to change back to the original JDK, just remove the JDK configuration!
JDK switching in Java (no need to uninstall the original JDK)