File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Not able to run java.exe from command prompt! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Not able to run java.exe from command prompt!" Watch "Not able to run java.exe from command prompt!" New topic
Author

Not able to run java.exe from command prompt!

Raghav Sam
Ranch Hand

Joined: Apr 12, 2001
Posts: 412
When I run the java.exe at the command prompt the following error occurs:

Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.4', but '1.3' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment.
.
I recently installed jdk 1.4. I just wanted to run an application from the command prompt and suddenly the above error is reported. However, javac works. So its not a 'PATH' problem. I suspect some problem with the registry. I did try to tinker with it. But I couldnt identify the problem. I am using Win 98.
All other applications using jdk 1.4 like Forte are working fine.
What could be the problem?


Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.<br />- Dr. Seuss
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
It sounds like your path and classpath are pointing at 1.3, so you compile it at jdk1.3 and invoke the jdk1.3 JVM, but when the system runs to the registry to find JAVA_HOME it sees 1.4 as the current version. So it complains that it can not find the 1.3 version (although WHY that should matter is unclear).
When you installed the 1.4 version, this all should have been updated for you . Did you install Forte afterwards perhaps and mess things up???
If you still have the downloaded executable for installing 1.4 why don't you try just executing that again.
Raghav Sam
Ranch Hand

Joined: Apr 12, 2001
Posts: 412
Originally posted by Cindy Glass:
It sounds like your path and classpath are pointing at 1.3, so you compile it at jdk1.3 and invoke the jdk1.3 JVM, but when the system runs to the registry to find JAVA_HOME it sees 1.4 as the current version. So it complains that it can not find the 1.3 version (although WHY that should matter is unclear).
When you installed the 1.4 version, this all should have been updated for you . Did you install Forte afterwards perhaps and mess things up???
If you still have the downloaded executable for installing 1.4 why don't you try just executing that again.

My PATH and CLASSPATH both point only at 1.4. And 1.3 is not in my system! (it was there is my system previously and i unistalled it before putting 1.4) Also all other binaries like jar, javac, appletviewer etc. work fine at the command prompt.
I have already tried reinstalling 1.4, but its no use.
I just now tried running regclean. still no use!
Dakshinamurthy Ramachandran
Greenhorn

Joined: Mar 09, 2002
Posts: 16
Very crude think ...
Just changed the Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
from '1.4', to '1.3'. Try then. Let us know what you are getting ....
Raghav Sam
Ranch Hand

Joined: Apr 12, 2001
Posts: 412
Originally posted by Dakshinamurthy Ramachandran:
Very crude think ...
Just changed the Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
from '1.4', to '1.3'. Try then. Let us know what you are getting ....

the following error:

Error opening registry key 'Software\JavaSoft\Java Runtime Environment\1.3'
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment.
sandyboy
Greenhorn

Joined: Apr 10, 2002
Posts: 4
uninstall and install again and then restart your machine


Sahil G<p>NY
Ashok Mash
Ranch Hand

Joined: Oct 13, 2000
Posts: 1936
Originally posted by Dakshinamurthy Ramachandran:

Just changed the Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
from '1.4', to '1.3'.

This is a sure fix. I used to do the same, then (in 2000) the conflict was between 1.2 and 1.3
Last of all, I will suggest you to uninstall all installed JVMs, remove every trace of anything that looks like a JVM , and then install only one ( 1.3 or 1.4 ) JVM.
Also, I have noticed that its always good to uninstall the existing JVM before installing a new one.
And yes, if you are using M$ Window$, don't forget to restart after every install/uninstall/mouse click
Cheers,
Ashok.


[ flickr ]
Raghav Sam
Ranch Hand

Joined: Apr 12, 2001
Posts: 412
Originally posted by J Ash:

This is a sure fix. I used to do the same, then (in 2000) the conflict was between 1.2 and 1.3
Last of all, I will suggest you to uninstall all installed JVMs, remove every trace of anything that looks like a JVM , and then install only one ( 1.3 or 1.4 ) JVM.
Also, I have noticed that its always good to uninstall the existing JVM before installing a new one.
And yes, if you are using M$ Window$, don't forget to restart after every install/uninstall/mouse click
Cheers,
Ashok.

Sure enough, I removed every trace of java from my system and also some keys of the registry which I thought as the trouble-makers. After that I reinstalled jdk1.4 and now everythings working fine. Thanx all of you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not able to run java.exe from command prompt!