[Solved] Error: could not open 'C:\Java\jre8\lib\amd64\jvm.cfg' (original) (raw)

Hello guys, if you are getting "Error: could not open 'C:\Java\jre8\lib\amd64\jvm.cfg'" error or just Error: could not open 'jvm.cfg and wondering what to do and how to solve this error then you have come to the right place. I will show you how I solved this error and how you can use my tips to solve your error as well. 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 a Java installation problem, so I went to the 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 the 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 the 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 Eclipse, but you can also see this with any other Java application like IntelliJIDEA, NetBeans or Minecraft.

Related troubleshooting guides
Here are some handy Java tips to solve some common errors and exception in Java: