英文:
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
添加到了我的 PATH
和 JAVA_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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论