运行 Java 会出现“错误:无法打开‘C:Program FilesJavajre6libamd64jvm.cfg'" [英] Running Java gives "Error: could not open `C:Program FilesJavajre6libamd64jvm.cfg'"

查看:36
本文介绍了运行 Java 会出现“错误:无法打开‘C:Program FilesJavajre6libamd64jvm.cfg'"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过多年的正常工作,我在尝试启动 JVM 时突然收到此消息:

After years of working OK, I'm suddenly getting this message when trying to start the JVM:

Error: could not open `C:Program FilesJavajre6libamd64jvm.cfg'

我尝试卸载,但收到一条消息说缺少 DLL(未指定)尝试重新安装,无济于事.

I tried uninstalling, and got a message saying a DLL was missing (unspecified) Tried re-installing, all to no avail.

同时,在尝试启动 Scala 时,我得到:

At the same time, when trying to start Scala I get:

Javajdk1.6.0_25injava.exe was unexpected at this time.

检查 %JAVA_HOME%%path% - 都OK

Checked %JAVA_HOME% and %path% - both OK

有人可以帮忙吗?

推荐答案

可能是一个稍微不同的原因,但第二个问题发生在 Win7 (x64) 上的 scala 2.9.0.1 中,尽管 scala-2.9.1.final已经解决了这里提到的这个问题:

Might be a slightly different cause, but that second issue occurs for me in scala 2.9.0.1 on Win7 (x64), though scala-2.9.1.final has already resolved this issue mentioned here:

Javajdk1.6.0_25injava.exe was unexpected at this time.

我的 %JAVA_HOME% 设置为这样的路径:c:program files(x86)Javajdk...

My %JAVA_HOME% set to a path like this: c:program files(x86)Javajdk...

注意空格和括号.

如果您将 %SCALA_HOME%inscala.bat 中的第 24 行从:

If you change line 24 in %SCALA_HOME%inscala.bat from:

if exist "%JAVA_HOME%injava.exe" set _JAVACMD=%JAVA_HOME%injava.exe

if exist "%JAVA_HOME%injava.exe" set "_JAVACMD=%JAVA_HOME%injava.exe"

它工作正常.请注意 set 命令参数周围的引号,这将正确括起变量值中的任何空格和特殊"字符(例如:空格和括号).

It works fine. Note the quotes around the set command parameters, this will properly enclose any spaces and 'special' characters (eg: spaces and parentheses) in the variable's value.

希望这有助于其他人寻找答案.

Hope this helps someone else searching for an answer.

这篇关于运行 Java 会出现“错误:无法打开‘C:Program FilesJavajre6libamd64jvm.cfg'"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆