The moose likes Beginning Java and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark ""java -v" command" Watch ""java -v" command" New topic

"java -v" command

jignesh soni
Ranch Hand

Joined: Dec 10, 2007
Posts: 150
When I run "java -v" on server, I get following error.
Registry key 'Software\Javasoft\Java Runtime Environment\CurrentVersion' has value '1.0', but '1.4' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment

So what does this mean ? Do I need to install jre and java 1.4 version ? This was working fine and there have been no changes, so why is this re
Rob Spoor

Joined: Oct 27, 2005
Posts: 20279

Open your registry editor (regedit.exe).
Go to HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment.
Open that key so all of its children are visible; there is probably one called "1.4".

Double click on the "CurrentVersion" on the right, and fill in that "1.4" (without quotes; you can also enter 1.5 or 1.6 if that child exist and you prefer that). After pressing enter it should work again.

Now how this problem is created. Have you installed some program lately that is shipped with an older JRE? That could have overwritten this value.

The java.exe inside C:\WINDOWS\system32 uses this piece of the registry to determine which JRE to run. It matches the value of "CurrentVersion" with one of the child keys, which contains the information needed to run the specific JRE.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: "java -v" command
jQuery in Action, 3rd edition