Dos下运行java文件报版本错误
时间:2010-04-27 来源:小树
在命令行DOS下运行java类,出现了如下的错误信息:
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.4', but '1.6' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment. 解决办法: 进入注册表:找到HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment 得知 CurrentVersion=1.4。后来我手动将CurrentVersion的值有原先的1.4改为1.6,因为我环境变量中path的值对应的是jdk1.6的路径。从新运行了一遍java类,运行OK!
has value '1.4', but '1.6' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment. 解决办法: 进入注册表:找到HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment 得知 CurrentVersion=1.4。后来我手动将CurrentVersion的值有原先的1.4改为1.6,因为我环境变量中path的值对应的是jdk1.6的路径。从新运行了一遍java类,运行OK!
相关阅读 更多 +