Couldn't install netbeans 11.3 with Java 14 due to Error: "Unsupported JVM version"

Couldn't install netbeans 11.3 with Java 14 due to Error: "Unsupported JVM version"

我正在尝试使用 Java 14.

安装 netbeans

我遇到以下错误 -

> sudo ./Apache-NetBeans-11.3-bin-linux-x64.sh --javahome /home/raj/.sdkman/candidates/java/current
Configuring the installer...
Searching for JVM on the system...
Unsupported JVM version at /home/raj/.sdkman/candidates/java/current.
Try to specify another JVM location using parameter --javahome

以下是我的 java 详细信息 -

> which java
/home/raj/.sdkman/candidates/java/current/bin/java


> java --version
openjdk 14 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)

我的OS详情是-

> lsb_release -a
LSB Version:    core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
Distributor ID: openSUSE
Description:    openSUSE Leap 15.1
Release:        15.1
Codename:       n/a

我该如何解决这个问题?

虽然 Apache NetBeans 11.3 完全支持使用 JDK 14,但不幸的是它的安装程序不支持。来自 Apache NetBeans 11.3 download page:

The installers will not run under JDK 14 because usage is made of the Pack200 Tools and API, for packing and unpacking, which is removed in JDK 14, see JEP 367.

有关 JDK 14 中进行此更改的原因的完整详细信息,请参阅 JEP 367: Remove the Pack200 Tools and API

您解决此问题的方法是:

  • 不要使用安装程序,而是下载并解压缩 Apache NetBeans 11.3(名为 netbeans-11.3-bin.zipfrom the download page。这种方法对我有用。
  • 安装 JDK < 14 的版本,然后您可以使用安装程序安装带有 JDK 的 NetBeans 11.3。安装 NetBeans 11.3 后,您可以编辑 netbeans.conf 使 JDK 14 成为默认的 Java 平台,或者简单地将其添加为第二个 Java 平台使用 工具 > Java 平台 > 添加平台...