Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.exe always point to the path of JRE but not JDK

I have both jdk and jre installed on my windows 7.

I have set the JAVA_HOME to

C:\Program Files\Java\jdk1.6.0_23

I have add

C:\Program Files\Java\jdk1.6.0_23\bin

to PATH.

but the java.exe still pointing to my jre dir, which is

C:\Program Files\Java\jre6\bin

since when I run

java.exe -server

it complains

Error: no `server' JVM at `C:\Program Files\Java\jre6\bin\server\jvm.dll'.

can anyone tell me what else do I need to set?

like image 393
Leon Avatar asked Mar 09 '11 19:03

Leon


1 Answers

since you are on windows, java doesn't work like that. there is a java.exe in some windows directory (%windir% system32 for you)

This java.exe actually looks in the registry HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment

PATH won't help ya! Since I tend to get lazy I delete the JRE and create a junction to the JDK instead.

like image 83
bestsss Avatar answered Oct 03 '22 06:10

bestsss