Search code examples
javajakarta-eeglassfishweblogicpayara

Payara server 5.192: cannot start with JDK11 on IntelliJ


I can start Payara v5.192 with JDK11 via command line, but it breaks after trying to start it via IntelliJ with the following error:

-Xbootclasspath/p is no longer a supported option

And I can't even start it via terminal any longer.

This is part of the IntelliJ log:

C:\Program Files\Java\jdk-11.0.3\bin\java.exe
-cp
D:/Program Files/payara-5.192/glassfish/modules/glassfish.jar
-XX:+UnlockDiagnosticVMOptions
-XX:NewRatio=2
-Xbootclasspath/p:D:\Program Files\payara-5.192\glassfish/lib/grizzly-npn-bootstrap-1.8.1.jar
[...]

My project is configured to use JDK 11.0.3, what might the issue be?

EDIT: I'm using IntelliJ 2019.1.3 on Windows, I don't get this issue on Debian

EDIT2: apparently the configuration changes after starting the domain with IntelliJ, here's domain.xml respectively before and after: https://pastebin.com/HAzFgkGn -> https://pastebin.com/F3r3nWet


Solution

  • I've encountered the same error myself, on macOS High Sierra. The reason for me was a conflict between the JDK version I'm running asadmin by default (1.8), and what IntelliJ put in the domain.xml (11.0.1).

    One workaround, besides updating your domain.xml, is to fix the JDK used by asadmin, e.g. by setting the AS_JAVA parameter in glassfish/config/asenv.conf.

    EDIT: Since IntelliJ ships with a bundled JDK 1.8, I believe asadmin is run using that instead of the configured JDK 11 causing the conflict -- asadmin appears to check the JDK it was run with and make some (in this case) wrong assumptions.

    EDIT 2: JB SDK is not related. The asadmin command is run using the JDK that's in path, instead of the one configured to the domain. You will get this error if your default (in path) JDK is <9, and your JDK configured to your domain is >=9, as the parameters for bootclasspath of npn are parameterized on the running JDK version.

    EDIT 3: Reported and confirmed as a bug: https://github.com/payara/Payara/issues/4025

    EDIT 4: The fix is merged to the repository, and is on track for the 5.193 release next month.