• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

JRE problem.

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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
 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
C:/j2sdk1.4.2_03/jre/...).

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

Best regards,
Petr
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jonny, what's the result of running the following three commands from a command prompt?

ECHO %PATH%
ECHO %CLASSPATH%
ECHO %JAVA_HOME%
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had the same problem and I used the Petr Blahos regedit solution.

It works!!
 
Don't touch me. And dont' touch this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic