13

I'm using Wildfly 14 and Java 11 in its runtime configuration. When I start the server I get

org.jboss.modules.ModuleNotFoundException: java.se
    at org.jboss.modules.Module.addPaths(Module.java:1266)
    at org.jboss.modules.Module.link(Module.java:1622)
    at org.jboss.modules.Module.relinkIfNecessary(Module.java:1650)
    at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:296)
    at org.jboss.modules.Main.main(Main.java:437)

How do I run Wildfly 14 with java 11?

Mark
  • 2,167
  • 4
  • 32
  • 64
  • Seems strange why `java.se` would not be available on the module path by default! Are you sure no other chained library is responsible for the exception resulting in here? Can you walk us through your setup? – Naman Oct 17 '18 at 10:04
  • @nullpointer it shouldnt be a setup issue. I found a discussion on https://issues.jboss.org/browse/MODULES-372 where someone mentions the change to java.se. There is also https://issues.jboss.org/browse/WFCORE-3962. – Mark Oct 17 '18 at 10:12
  • The issue appears to be fixed: https://issues.jboss.org/browse/WFLY-10937. I just installed WildFly 15.0.1.Final on ubuntu 14.04 and it works without modifications. – Kawu Jan 12 '19 at 21:18
  • @Kawu yes it was fixed months ago (i said in the answer too) but not for 14 which is what the question is for. – Mark Jan 15 '19 at 17:04

1 Answers1

29

There was some change in Java 11 where java.se must be read on the module path. In Wildfly's run configuration under VM arguments add

--add-modules=java.se

Should be fixed in later versions.

Mark
  • 2,167
  • 4
  • 32
  • 64
  • 1
    Could you please point me to "In Wildfly's run configuration under VM arguments"? Where can i find that? – Dorian Gray Jan 04 '19 at 17:45
  • 4
    @DorianGray For instance, if you start the server in standalone mode via standalone.sh or .bat, add the following line where the JAVA_OPTS variable is set: rem # Add Java module java.se set "JAVA_OPTS=%JAVA_OPTS% --add-modules=java.se" – Jens Kreidler Jan 07 '19 at 16:08
  • Thanks, and how do I start it in eclipse like that? Is it a setting in eclipse or in Wildfly config? – Dorian Gray Jan 07 '19 at 18:22
  • 3
    @DorianGray I assume you've got a configured server runtime in the Eclipse Server view. Double-click the server and open the server's settings tab. There you'll find the link "Open launch configuration" (alternatively, go to the launch config directly). Here you can edit the server's program arguments (and the VM arguments). It could be an issue, if you leave the checkbox "Always update the arguments related to the runtime" checked. Thus, these arguments will be updated as the server's configuration is done, so it should be OK if you edit the standalone.conf(.sh or .bat) or just uncheck it. – Jens Kreidler Jan 08 '19 at 12:36
  • @JensKreidler Thanks, that helped – Dorian Gray Jan 08 '19 at 18:57
  • For those who are running Wildfly inside Eclipse, I was adding the "--add-modules=java.se" on the "Open Launch Configuration" and putting it in the beginning of the "VM arguments". It doesn't work, I needed to put at the end. – chuckedw Jun 21 '23 at 16:42