简体   繁体   English

JDK 11安装问题

[英]JDK 11 Install Issue

So i was trying to start Java, and download JDK 11. Also updated the JRE to the latest version. 因此,我试图启动Java,并下载JDK11。还将JRE更新为最新版本。 After installation and compiling my first "hello world" to " xxx.class ", trying to run it with: 安装并将我的第一个“ hello world”编译为“ xxx.class ”后,尝试使用以下命令运行它:

java xxx

turned up an error of incompatible versions (the compiled file was v.55 while the JRE version only interpreted files up to version 52.) 出现错误的版本不兼容(编译文件为v.55,而JRE版本仅解释了版本不超过52的文件。)

So i unistalled JDK 11 and installed JDK 8. Now in my Java folder there is both a JDK.version_xxx and a JRE.version_xxx file, whereas when i installed JDK 11 there wasn't a JRE file installed (which i think was stated in the changes that happened in the new JDK 11 version). 因此,我取消安装JDK 11并安装了JDK8。现在在我的Java文件夹中既有JDK.version_xxx也有JRE.version_xxx文件,而当我安装JDK 11时,没有安装JRE文件(我认为在在新的JDK 11版本中发生的更改)。

Where and what JRE do i need to get to run files compiled with JDK 11? 运行JDK 11编译的文件,我需要在哪里以及需要什么JRE?

JRE is no longer part of Java 11, as per JDK 11 Release Notes : 根据JDK 11发行说明 ,JRE不再是Java 11的一部分:

In this release, the JRE or Server JRE is no longer offered. 在此版本中,不再提供JRE或Server JRE。 Only the JDK is offered. 仅提供JDK。 Users can use jlink to create smaller custom runtimes. 用户可以使用jlink创建较小的自定义运行时。

Either compile against version of the target JRE or build a custom runtime with jlink . 可以根据目标JRE的版本进行编译,也可以使用jlink构建自定义的运行时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM