java更新 位置,Java自动更新时是否更新Windows路径变量?

This question asks how to setup your path variable in Windows to include the Java bin directory allowing you to use the javac command from the prompt. The solution posted to this question states you should hard code the absolute path of the latest Java installation.

In this case it happens to be c:\program files\java\jdk1.6.0_16\bin

I believe once Java update 17, 18 and beyond are installed your javac cmd will still be using this older version, correct?

Am I missing something?? Is there a way to set this to automatically use the most recent installed java update??

解决方案

I believe once Java update 17, 18 and beyond are installed your javac cmd will still be using this older version, correct?

Correct. When java is update, what get's updated is the JRE ( java runtime environment )

That automatically set your java plugin ( used in the browser ) and your java command set to the latest version. ( Open a terminal and type java -version )

The SDK ( Java SDK ) which contains the javac is not changed. You have to do it manually.

One option is do what mhaller says.

I go further using the environment variables in Windows.

MyPC/RigthClick/Properties/Advaced/EnvironmentVariables/

From there I add JAVA_HOME poiting to the desired JDK path ( c:\jsdk_x_x_x ) and set the PATH variable to:

whatever;_it_had;_before;%JAVA_HOME%\bin

Is there a way to set this to automatically use the most recent installed java update??

For the JRE it would be automatically set, for the SDK you'll only need to modify the system variables and change the value of JAVA_HOME

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值