2

In my application which is running on Java 8 I used third party library which is using org.jboss.logmanager.LogManager So I added this jar in bootclass path and it works fine. But when migrate to java 11 either -Xbootclasspath/a or -Xbootclasspath/p is not working and I can not start my application.

set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/a:D:/wildfly-10.1.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.4.Final.jar

I found How to add a jar to the boot classpath in java 9 answer. But it is not working for java 10 or 11. Can anyone please help me?

JagKum
  • 183
  • 2
  • 18
  • I would think the `-Xbootclasspath/a` should work. Is there an error you're seeing or do you have a way to reproduce it? – James R. Perkins Nov 30 '18 at 00:10
  • Thanks @JamesR.Perkins for your reply. It can easily reproduce by adding below options to standalone.conf.bat ; set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/a:D:/wildfly-10.1.0.Final/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.4.Final.jar – JagKum Nov 30 '18 at 06:06
  • Are you using an agent? FWIW WildFly 10 has not been tested with Java 11. – James R. Perkins Dec 03 '18 at 18:19
  • yes I'm trying to use Azure ApplicationInsight java agent. – JagKum Dec 03 '18 at 18:45
  • 1
    Maybe have a look at the workaround in [LOGMGR-218](https://issues.jboss.org/browse/LOGMGR-218?focusedCommentId=13669721&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13669721). Note though WildFly 10 is not really tested on Java 11. You might want to consider WildFly 15. – James R. Perkins Dec 04 '18 at 21:45

2 Answers2

0

I tried the following:

(1) For me replacing -Xbootclasspath/p with -Xbootclasspath/a - Did not work

(2) Then I tried to remove the whole line as this has been suggested by others -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p: <path_to_jboss_logmanager>/jboss-logmanager-<version>.jar - Did not work

(3) Then I also removed the logmanager from -Djboss.modules.system.pkgs=org.jboss.logmanager" and then it worked!

So only the combination of 2+3 finally worked.

Lonzak
  • 9,334
  • 5
  • 57
  • 88
-2

In JAVA jdk 11 and above, if you are developing a java console app then you only need to set the PATH environment variable. You do not need to set the CLASSPATH environment variable.

Zahra
  • 6,798
  • 9
  • 51
  • 76