jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes JRE problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JRE problem." Watch "JRE problem." New topic

JRE problem.

Jonny Butamer

Joined: Oct 27, 2004
Posts: 15

I have been trying to set up a java environment on a windows system. I have downloaded the SDK and set my classpath and path variables. I can compile my code no problem but get a problem when i try to run the programs. I get the following error "Error: Could not open 'C:\Program Files\Java\j2re1.4.1_01\lib\i386\jvm.cfg'". I assumed that windows is looking for the JVM in this directory but cannot find it because its not there. My question is why is windows looking is this directory and not the directory I have set in my PATH variable? and can I change this? If not how do I fix the problem?

Thanks for any help
Petr Blahos
Ranch Hand

Joined: Apr 28, 2004
Posts: 131
Simple answer: because windows suck. Start regedit, go to
HKLM/Software/JavaSoft/Java Runtime Environment/ and find value
CurrentVersion. I have 1.4 there. Then there should be some
subkeys, one of them will be the one found in "CurrentVersion".
Check the paths in there.

Now if any of the subsection match the reality, you can
change the "CurrentVersion" to the name of that section.
Otherwise you can try modifying the paths in the "CurrentVersion"
section to the paths you would like to see there (maybe

And finally: I will accept no responsibility whatsoever for
any damage made by following the instructions above.

Best regards,

Get a better web browser:<br /><a href="http://www.mozilla.org/products/firefox/switch.html" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/switch.html</a>
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
it's not Windows that sucks (please keep your anti-Microsoft zealotness comments on /. where they belong).
This looks like a misconfiguration issue resulting from something going wrong during JRE installation (which is part of the J2SDK installation which is a Sun product built around a product created by InstallShield corporation so no Microsoft involvement at all).

The JRE is installed as standard in the location you mentioned even if you set the SDK installation path to something else.

Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
jonny cool,

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

Thanks Pardner! Hope to see you 'round the Ranch!

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
jonny, what's the result of running the following three commands from a command prompt?

Nubio Laterza

Joined: Jan 11, 2006
Posts: 1
I had the same problem and I used the Petr Blahos regedit solution.

It works!!
I agree. Here's the link: http://aspose.com/file-tools
subject: JRE problem.
It's not a secret anymore!