Error: could not open 'C:\Java\jre8\lib\amd64\jvm.cfg'

A couple of weeks back I updated my laptop to Windows 10 but after trying for one day, I reverted back to Windows 8.1. Everything was alright until I open Eclipse, which was throwing "Error: could not open 'C:\Program Files\Java\jre8\lib\amd64\jvm.cfg', as soon as I launch it. It was quite bizarre because everything was fine earlier. I suspect Java installation problem, so I went to command prompt and typed Java, only to find the same error there as well. You can see below, I am just trying to run the "java" command from MS-DOS window. Here "java" command is picked from PATH environment variable.

$ java
Error: could not open `C:\Program Files\Java\jre8\lib\amd64\jvm.cfg'

Then I checked my environment variables, JAVA_HOME and PATH and they all refer to C:\Program Files\Java. So this bit frustrating. After some time, I found that the default installation also copied java.exe, javaw.exe and javaws.exe to C:\Windows\System32 (i.e. uninstall of JRE didn't go well). I just removed them and voila, the error was gone. That annoying error is no longer popping.

Error: could not open 'C:\Java\jre7\lib\i386\jvm.cfg' - Solution

If you are facing the same problem i.e. getting the Error: could not open 'C:\Java\jre7\lib\i386\jvm.cfg', then check your System32 folder and remove java.exe, javaw.exe, and javaws.exe if they exist there.

Here are the exact steps to solve could not open 'C:\Program Files\Java\jre8\lib\amd64\jvm.cfg' error:

1) Go to C:\Windows\System32
2) Search for Java in that folder
3) Remove java.exe, javaws.exe and javaw.exe from this folder
4) Open command prompt
5) Type Java it should work

Mind you, your error could be little different than mine depending upon whether your laptop is 32-bit or 64-bit. For example, if you are using 32-bit JVM then you can get something like Error: could not open 'C:\Java\jre7\lib\i386\jvm.cfg'.

Error: could not open 'C:\Program Files\Java\jre8\lib\amd64\jvm.cfg'

That's all about how to fix this error: could not open 'C:\Program Files\Java\jre8\lib\amd64\jvm.cfg' in Windows 8 and Windows 10. I have got this with the Eclipse, but you can also see this with any other Java application e.g. NetBeans or Minecraft.

Related troubleshooting guides
Here are some handy Java tips to solve some common error and exception in Java:
  • How to fix Caused By: java.lang.NoClassDefFoundError: org/apache/log4j/Logger (solution)
  • How to solve "could not create the Java virtual machine" error in Java? (solution)
  • Fixing java.lang.unsupportedclassversionerror unsupported major.minor version 50.0 (solution)
  • How to avoid ConcurrentModificationException while looping over ArrayList in Java? (solution)
  • How to solve java.lang.ClassNotFoundException: com.mysql.jdbc.Driver error? (hint)
  • How to fix java.lang.OutOfMemoryError: Direct Buffer Memory? (solution)
  • How to solve java.lang.classnotfoundexception oracle.jdbc.driver.oracledriver? (solution)
  • java.lang.ClassNotFoundException : org.Springframework.Web.Context.ContextLoaderListener (solution)
  • How to deal with java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject? (solution)
  • Difference between NoClassDefFoundError and ClassNotFoundException? (answer)
  • How to fix 'javac' is not recognized as an internal or external command (solution)
  • java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory error (solution)
  • How to solve java.lang.OutOfMemoryError: Java Heap Space in Eclipse, Tomcat? (solution)
  • How to fix java.lang.OutOfMemoryError: Java Heap Space in Eclipse, Tomcat? (solution


  1. Replies
    1. @Khusbhu, Glad to know that this tip helped you :-)

  2. Did not work for me, I'm on Windows 8 and my message says the same as yours.

    1. did you find a fix? This solution did not fix my problem either.

  3. Thanks man .. It worked for me