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

前端 未结 21 2285
别跟我提以往
别跟我提以往 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:28

    Reinstalling java didn't help me. But the trick to put the JAVA_HOME variable at the beginning of the env-vars. The problem occoured after an upgrade from jdk1.7.0_11 to jdk1.7.0_13

    0 讨论(0)
  • 2020-11-27 18:30
    C:\ProgramData\Oracle\Java\javapath
    

    I took a back up of the files in it and removed those files from there. Then I opened a new cmd prompt and it works like a charm.

    0 讨论(0)
  • 2020-11-27 18:30
    • I had a similar problem (trying to start a Jenkins slave agent on Windows) on Windows 2008R2, Java 1.7.0_15

    • I had two situations that contributed to the problem and that changing both of them fixed it:

      1) Installing Java in a unix-compatible path (changing from c:\Program Files\... to c:\Software\...); I don't think this directly affected the problem described in this thread, but noting the change;

      2) Running Java not through a shortcut. It originally failed with a shortcut, but re-running from the direct executable (C:\Software\Java...\bin\java) worked.

    0 讨论(0)
  • 2020-11-27 18:32

    Another workaround is using shortpath in windows:

    1. open windows command console using cmd.exe
    2. goto c:\
    3. type command> dir program* /x
    4. it should display as short path like: PROGRA~2
    5. so C:\PROGRA~2 is same as C:\Program Files (x86)
    6. in your JAVA_HOME replace path to : C:\PROGRA~2\Java\jre7

    This should work in windows 64 environment as it worked for me in win7 64bit version.

    0 讨论(0)
  • 2020-11-27 18:33

    I had this problem after updating your java. The best way to solve this problem is just go to your c:/ProgramFiles/Java folder. There you will find two jre folders one is as jre.your version and other with exactly like jdk folder. Try to remove jre.1.your version folder. There you go your problem is solved. Hope this might help. It's worked for me.

    0 讨论(0)
  • 2020-11-27 18:33

    It wasn't in the path. Finally fixed by uninstalling java, removing all references to it from the registry, and then re-installing. None the wiser, but back working again. Thanks all @Highland Mark- Can you tell me the process to removing references from registry. I tried all possible way people mentioned here, nothing worked.

    0 讨论(0)
提交回复
热议问题