Fix win7 install after jdk7, then install JDK8 problem has the value ' 1.8 ', but ' 1.7 ' is required.

Source: Internet
Author: User

http://blog.csdn.net/qiyueqinglian/article/details/46605759

The computer installed the Jdk8,java_home is also set 8.
Do not delete 8 change back to 7.
Changed the Java_home, and the C:\ProgramData\Oracle\Java\javapath in the path value was deleted.
Run Java-version, error
Error:registry key ' Software\javasoft\java Runtime environment ' \CurrentVersion '

Have value ' 1.8 ', but ' 1.7 ' is required.
Error:could not find Java.dll
Error:could not find Java SE Runtime environment.

Solution
1. Open the Start menu, search regedit, open the registry
2. Open "HKEY_LOCAL_MACHINE"
3. Click "Software"
4. Click "JavaSoft"
5. Click "Java Runtime Environment"
6. Select "CurrentVersion" and right click on change to "1.7"
Problem solved.

According to the above modification, cmd input java-version or display version 1.7

Http://www.cnblogs.com/weicleer/p/4273278.html himself Win7 x64 flagship version, at the same time installed JDK7 and JDK8, uninstalled JDK8, cmd command line input: Java-version, Thought to show Java version 1.7, the result was wrong: has the value ' 1.7 ', but ' 1.8 ' is required.

I looked at java_home, environment variables, and found no problem, pointing to C:\Java\jdk1.7.0

Workaround:

Because JDK8 is installed after JDK7 is installed, the three executables for Java.exe, Javaw.exe, and Javaws.exe are automatically copied to the C:\Windows\System32 directory when the JDK1.8 is installed. Because this directory has a higher precedence in Windows environment variables than the environment variables set by Java_home.

Understand this, you know the reason for the error, although uninstalled JDK1.8, but the C:\Windows\System32 directory of Java.exe, Javaw.exe, Javaws.exe three executable files or JDK1.8, so the JDK1.7 java_home\bin under the three corresponding executable file to overwrite the C:\Windows\System32 directory, at this time in the cmd command line input: Java- Version, everything is fine.

I happened to be the opposite of him, so I replaced a few jdk8 files to cover the C:\Windows\System32 directory.

Press the above changes, cmd input java-version display version 1.8

Fix win7 install after jdk7, then install JDK8 problem has the value ' 1.8 ', but ' 1.7 ' is required.

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.