[讨论] 关于JRE的路径问题,稍微有点小白。。。

ningandjin 2012-01-21
OS: Windows 7
JDK:jdk1.6.0_21

我的安装目录如下:
C:\Program Files\Java\jdk1.6.0_21\bin\java.exe
                                                  \jre\java.dll
                                                    ..................
                                 \jre6\bin\
我配置的环境变量如下
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_21
Path=%JAVA_HOME%\bin
classpath=.;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\rt.jar

按照java_md.c代码GetJREPath,应该是通过java.exe找到C:\Program Files\Java\jdk1.6.0_21,然后判断C:\Program Files\Java\jdk1.6.0_21 \jre\java.dll存在,返回jre的路径为C:\Program Files\Java\jdk1.6.0_21 \jre,可是我跑java -version的时候,输出结果如下:
----_JAVA_LAUNCHER_DEBUG----
Version major.minor.micro = 1.6.0
JRE path is C:\Program Files\Java\jre6
EnsureJreInstallation:<C:\Program Files\Java\jre6\lib\bundles>:not found
jvm.cfg[0] = ->-client<-
jvm.cfg[1] = ->-server<-
jvm.cfg[2] = ->-hotspot<-
    name: -hotspot  vmType: VM_ALIASED_TO  alias: -client
jvm.cfg[3] = ->-classic<-
jvm.cfg[4] = ->-native<-
jvm.cfg[5] = ->-green<-
959 micro seconds to parse jvm.cfg
Default VM: client
JVM path is C:\Program Files\Java\jre6\bin\client\jvm.dll
Version major.minor.micro = 1.6.0
JRE path is C:\Program Files\Java\jre6
CRT path is C:\Program Files\Java\jre6\bin\msvcr71.dll
64283 micro seconds to LoadJavaVM
JavaVM args:
    version 0x00010002, ignoreUnrecognized is JNI_FALSE, nOptions is 2
    option[ 0] = '-Djava.class.path=.;C:\Program Files\Java\jdk1.6.0_21\lib\tool
s.jar;C:\Program Files\Java\jdk1.6.0_21\lib\dt.jar'

这是为什么啊?我漏掉了哪个逻辑吗?
RednaxelaFX 2012-01-21
你可以试试把%WINDOWS%\system32\java.exe改名或者备份后删掉,看看会怎样

如果有变化的话说明这是你系统上的Public JRE干的好事。其实"C:\Program Files\Java\jre6"就是Public JRE的默认安装路径,没啥疑问。
Global site tag (gtag.js) - Google Analytics