Why do I get Error: could not open `C:\Program Files\Java\jre7\lib\i386\jvm.cfg

In this post, I will take a problem solution approach.

Problem:
While executing a jar from command line or while executing a java command to run any program, following error get displayed.

"Error: could not open `C:\Program Files\Java\jre7\lib\i386\jvm.cfg"

Solution 1:
Check the PATH environment variable.
Make sure, it consist of path to bin directory of your Java JDK installation.

Example path upto bin : C:\Program Files\Java\jdk1.7.0_71\bin

If the variable is not as above, do change it appropriately. If you don't know how to change the value,
please refer this post.
Make sure you restart your command prompt after you newly set the variable. Otherwise, changes will not come in effect.

Solution 2:
While doing Java installation, following 3 files get copied to C:\Windows\System32
  • java.exe
  • javaw.exe
  • javaws.exe
Check if this is the case by opening the folder. If yes, delete these files. These files are from jre distribution but as we need files from JDK distribution, we don't need these.

Hope either of above solution works for you.

Comments

Popular posts from this blog

Preparing applications for migration to Oracle 11G from Oracle 10G

Getting started with Weblogic Maven Plugin