0

需要在 MacOS 上运行 GlassFish5。当前安装的版本是JDK11.02和JDK1.8.0_144。

>echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home

>which java
/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin/java

>java -version
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

我在文件的最后一行附加glassfish5/bin/asenv.batAS_JAVA=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home

在启动 GlassFish 时,我仍然遇到 NPE 异常:

>asadmin start-domain
Exception in thread "main" java.lang.NullPointerException

我错过了什么?

还是无法在带有 JDK11 的 MacOS 上运行带有 JDK 8 (u144) 的 GlassFish?

4

1 回答 1

0

您需要设置 in ,而不是设置AS_JAVA变量in 。asenv.batAS_JAVAglassfish5/config/asenv.conf

AS_JAVA=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home

于 2019-06-11T22:59:45.030 回答