不要在命令提示符中看到 Java 版本 14。

huangapple go评论70阅读模式
英文:

Don't see java version 14 in command prompt

问题

我从 https://www.oracle.com/java/technologies/javase-jdk14-downloads.html 安装了 jdk-14.0.1_windows-x64_bin.exe

我将 C:\Program Files\Java\jdk-14.0.1\bin 添加到了我的 PATHJAVA_HOME 变量中。
在此之后,我启动了一个新的命令提示符窗口,输入 java -version,然后我看到了下面的列表,但是我没有看到 java version "14.0.1",为什么呢?

> java version "1.8.0_251" Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
> Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)

我已经查看了这个帖子

英文:

I installed jdk-14.0.1_windows-x64_bin.exe from https://www.oracle.com/java/technologies/javase-jdk14-downloads.html.

I added C:\Program Files\Java\jdk-14.0.1\bin to my PATH and JAVA_HOME variables.
After this I start a new command prompt and type java -version, and I see the list below, but I don't see java version "14.0.1", why not?

> java version "1.8.0_251" Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
> Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)

I already checked this post.

答案1

得分: 3

当您将新版本的Java添加到您的PATH以将其用作默认版本时,还应确保它是PATH唯一的版本。

在这种情况下,您的PATH中已经有了Java 8,并且它被用作默认版本,而不是新的Java 14,因此解决方案是从PATH中删除Java 8。

英文:

when you add a new version of Java to your PATH to use it as default you should also make sure that it is the only one in your PATH.

in this case, you already had Java 8 in your PATH and it was being used as default instead of the new Java 14, so the solution is to remove Java 8 from the PATH.

huangapple
  • 本文由 发表于 2020年6月29日 16:40:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/62634280.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定