总是指向JRE但不是JDK的路径 [英] java.exe always point to the path of JRE but not JDK

查看:217
本文介绍了总是指向JRE但不是JDK的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Windows 7上安装了jdk和jre。



我已将JAVA_HOME设置为

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

我添加了

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

到PATH。



但是java。 exe仍然指向我的jre目录,这是

  C:\Program Files\Java\jre6\bin 

自从我运行

  java.exe -server 

它抱怨

 错误:在`C:\Program Files\Java\jre6\bin\server\jvm.dll'中没有`server'JVM。 

任何人都可以告诉我还有什么需要设置?

解决方案

既然你在windows上,java就不行了。
某些Windows目录中有一个java.exe(%windir%system32为您)



这个java.exe实际上在注册表中 HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java运行时环境



PATH不会帮助你!因为我倾向于懒惰,我删除了JRE,并创建了一个连接到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?

解决方案

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.

这篇关于总是指向JRE但不是JDK的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆