Oracle MVA

Tales from a Jack of all trades

could not open jre6\lib\i386\jvm.cfg

with 2 comments

Recently I spend some time at a customer that runs Windows, Windows 2008 R2 to be exact. My advise: don’t, especially that UAC business costs lots of extra time. Oracle and Windows is not match in heaven, but if you happen to end up at a customer running that operating system you might run into the error I used as title for this blogpost too. The error is generic for any Windows system.

When you install a new JDK (don’t forget to run as administrator) and install this in a new JAVA_HOME, this all works perfectly. Only when you next open a dosbox by calling cmd (again, don’t forget to run as administrator again) set your JAVA_HOME and PATH and call java -version you end up with the dreaded could not open jre6\lib\i386\jvm.cfg error. This is kind of annoying, since no references to any JAVA_HOME is in your PATH apart from the one you just set.

It turns out that upon installation of the first JDK actually java.exe (and some more java* executables) are copied to c:\windows\system32 and that happens to be the location of your cmd box when you open it. Since . is in the path first, you run the local java.exe when you call java instead of the java.exe from JAVA_HOME/bin (what I expected).

navigate to some other directory before you call java (like cd \ ) or delete the java.exe file from c:\windows\system32 . The latter could give some unexpected results so navigating to a different directory is what I prefer.

Hope this helps.


Written by Jacco H. Landlust

February 10, 2013 at 9:11 pm

Posted in Installing, Windows

2 Responses

Subscribe to comments with RSS.

  1. Aren’t the java files in system32 some kind of link or wrapper? On my win2003 servers and win7 PC I have java.exe, javaw.exe and javaws.exe but they’re all about 170kB so definitely not the full java executable itself. On my PC if I run c:\windows\system32\java -version I get the same version number as the latest installed from my Program Files (x86) directory (out of all my JREs and JDKs in there) so presumably the Java installer either updates the system32 java.exe or there’s some registry entry telling it which runtime to call. So perhaps there was something wrong with the java installation on your servers.

    Note: the ones I’ve looked at have been HotSpot 7 not 6 as you have so I don’t know if it has changed in 7.

    Simon Haslam

    February 10, 2013 at 10:26 pm

  2. Ah… actually there’s a handy post on the topic here:
    (check the pages linked in the answers too).

    It sounds like it’s further complicated by 32/64 bit on Windows too (the servers/middleware will be running the 64 bit JVM presumably).

    It all seems a bit messy really…

    Simon Haslam

    February 10, 2013 at 10:33 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: