File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JRE problem.

 
Jonny Butamer
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Petr Blahos
Ranch Hand
Posts: 131
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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%
 
Nubio Laterza
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had the same problem and I used the Petr Blahos regedit solution.

It works!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic