java中0.33,“system32 \java.exe”之间有什么区别?和“Program Files\Java\jdk1.6.0_33\bin\java.exe”?...

I have just installed Java JDK 6u33 in Windows XP. Even though I didn't set the PATH environment variable, I am able to run java -version in command prompt.

When I run this command for %i in (java.exe) do @echo. %~$PATH:i, I get this output:

C:\WINDOWS\system32\java.exe

When I check my PC, I found that there are 2 java.exe:

1. C:\Program Files\Java\jdk1.6.0_33\bin\java.exe

2. C:\WINDOWS\system32\java.exe

May I know what is the difference between system32\java.exe and Program Files\Java\jdk1.6.0_33\bin\java.exe? Why only system32\java.exe is shown when I run for %i in (java.exe) do @echo. %~$PATH:i?

Do I still need to add C:\Program Files\Java\jdk1.6.0_33\bin\ to my PATH environment variable?

解决方案

Setting the PATHvariable is just so that you can get access to javac and the other programs and tools in the jdk bin folder.

The java.exe in \windows\system32\ is provided so that not everyone needs to set a PATH variable just to run a java program (from the command line) and selects a version (the last one installed it seems) of the installed java virtual machines (JVM) if there are more than one (publicly) installed.

See this link for further info:

Quote:

To complicate things further the java.exe in system32 is just a dummy.

It looks in the registry and then decides which real java.exe to use.

The last JVM installed gets to be the one used, even if it is older.

To switch JVM s, you must normally reinstall the one you want.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值