HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion to 1.6 you will get the following error:
C:\Windows\System32>java -help
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.6', but '1.7' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
I found two solutions on this problem:
1) use -version:1.6 as parameter
java -version:1.6 -jar myprogram.jar
It will run the jar with version 1.6
Of course you can set it into some system property like JAVA_OPT (for tomcat)
2) Add JAVA_HOME environment variable, and put %JAVA_HOME%\bin before %SystemRoot%\system32.
So the JAVA_HOME\bin\java.exe will be found before the c:\windows\system32\java.exe wrapper.
1 comment:
it worked great! thank you!
Post a Comment