Running Java gives “Error: could not open `C:\Program Files\Java\jre6\lib\amd64\jvm.cfg'”

前端 未结 21 2441
别跟我提以往
别跟我提以往 2020-11-27 17:38

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

Error: could not open `C:\\Program Files\\Java\\jre6\\lib\\amd64\         


        
21条回答
  •  情深已故
    2020-11-27 18:34

    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:

    \Java\jdk1.6.0_25\bin\java.exe was unexpected at this time.
    

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

    Note the space and the parentheses.

    If you change line 24 in %SCALA_HOME%\bin\scala.bat from:

    if exist "%JAVA_HOME%\bin\java.exe" set _JAVACMD=%JAVA_HOME%\bin\java.exe
    

    to

    if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
    

    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.

提交回复
热议问题