Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Registry key CurrentVersion incorrect and cannot find java.dll

843811Oct 5 2004 — edited Oct 7 2004
I have been reading the posts in this forum related to similar errors but not quite sure that they address this situation. Here is what I am seeing:

I have j2sdk 1.4.2_05 on WindowsXP and the HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion has the value 1.4.2_05. The j2sdk install copied the java.exe to C:\j2sdk1.4.2_05\bin, C:\j2sdk1.4.2_05\jre\bin and C:\Program Files\Java\j2re1.4.2_05\bin folders. It also copied the same file to the windows\system32 folder. So far so good.

In my windows PATH env. variable, the windows\system32 path comes first . So when on the DOS prompt, I type "java -version" or even "C:\windows\system32\java -version", I get the following error :

Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.4.2_05', but '1.4' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment.

However, running
C:\j2sdk1.4.2_05\bin\java -version OR
C:\j2sdk1.4.2_05\jre\bin\java -version OR
"C:\Program Files\Java\j2re1.4.2_05\bin\java" -version
works and I get the version info for 1.4.2 j2sdk.

Now I know that prefixing j2sdk bin path to the PATH variable, so that it comes before windows\system32 will set it right. But I think I should not have to do that , if the j2sdk installation has already copied the latest java.exe to the windows\system32 folder. If it was just an issue of java.exe in windows\system32 being in sync with the JRE current version in registry, I think even just "java -version" should have worked. Since that is not working, maybe there is something beyond that. At this time, I do not know what that could be.

Any suggestions?


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 4 2004
Added on Oct 5 2004
1 comment
601 views