Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
418 views
in Technique[技术] by (71.8m points)

java - 如何使用最新的Java SE版本?(How to use the latest Java SE version?)

I had Java SE (version 8) installed on my computer (Windows 10).

(我在计算机(Windows 10)上安装了Java SE(版本8)。)

Now, I have downloaded version 13. I have also added the path

(现在,我下载了版本13。我还添加了路径)

C:\Program Files\Java\jdk-13.0.1\bin

(C:\ Program Files \ Java \ jdk-13.0.1 \ bin)

in Environment Variables -> System Variables -> Path

(在环境变量->系统变量->路径中)

But still when I write

(但是当我写的时候)

java -version

(Java版本)

on cmd, I get the path of the older version.

(在cmd上,我得到了旧版本的路径。)

java version "1.8.0_231"

(Java版本“ 1.8.0_231”)

Java(TM) SE Runtime Environment (build 1.8.0_231-b11)

(Java(TM)SE运行时环境(内部版本1.8.0_231-b11))

Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

(Java HotSpot(TM)64位服务器VM(内部版本25.231-b11,混合模式))

Upon writing

(写作时)

where java

(哪里java)

I got the following result

(我得到以下结果)

C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe

(C:\ Program Files(x86)\ Common Files \ Oracle \ Java \ javapath \ java.exe)

C:\ProgramData\Oracle\Java\javapath\java.exe

(C:\ ProgramData \ Oracle \ Java \ javapath \ java.exe)

C:\Program Files\Java\jdk-13.0.1\bin\java.exe

(C:\ Program Files \ Java \ jdk-13.0.1 \ bin \ java.exe)

In the environment variables ->

(在环境变量中->)

I get the following relevant paths:

(我得到以下相关路径:)

C:\ProgramData\Oracle\Java\javapath

(C:\ ProgramData \ Oracle \ Java \ javapath)

C:\Program Files\Java\jdk-13.0.1\bin

(C:\ Program Files \ Java \ jdk-13.0.1 \ bin)

Note: doesn't have the path of Java 8 as I deleted it.

(注意:我删除Java 8时没有路径。)

Interestingly, I am still able to run the Java code.

(有趣的是,我仍然能够运行Java代码。)

I am confused now..

(我现在很困惑。)

  ask by Ricky translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Move C:\Program Files\Java\jdk-13.0.1\bin to the top in the list of environment variables.

(将C:\Program Files\Java\jdk-13.0.1\bin到环境变量列表的顶部。)

Then, open a new command prompt and execute java -version .

(然后,打开一个新的命令提示符并执行java -version 。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...