OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.15k stars 592 forks source link

Settings of java9.options property file related to jdk.attach module doesn't work with Java 11 #20135

Open hmozaffari opened 2 years ago

hmozaffari commented 2 years ago

There is a reference to jdk.attach module in java9.properties file: https://github.com/OpenLiberty/open-liberty/blob/ea3de543bd8db9fc5b3103653c5a1a0a9fcda0b5/dev/com.ibm.ws.kernel.boot/publish/platform/java/java9.options#L15

Since jdk.attach module is not available in JRE 11 (it has been moved to JDK), at startup server shows the following warning:

WARNING Unknown module: jdk.attach specified to --add-exports

Ideally server should use a different property file for Java 11 or allow users to override it with options like jvm.options file.

jhanders34 commented 2 years ago

Are you using the JRE or the JDK? My guess is that you are using the JRE which will give you this message.

hmozaffari commented 2 years ago

Yes I’m using JRE. I found similar issue related to localConnector-1.0 feature in #8981 . Is there any option other than ignoring the warning or modifying that system property file? Thanks

prandhir commented 9 months ago

We are also in the same boat where using "ibm-semeru-open-jre_x64_windows_17.0.8.1_1_openj9-0.40.0" and Liberty server 23.0.0.10. while starting the server with local connector feature , getting class not found exception for class "com.sun.tools.attach.VirtualMachine". was there any work around suggested ?

jhanders34 commented 9 months ago

You need to either use JDK or you need to add the jdk.attach module to your JRE from a JDK. localConnector-1.0 requires JDK or the jdk.attach module from a JDK.