-
Bug
-
Resolution: Done
-
Major
-
None
-
None
When a user setup a JDK in a path containing a space, wildfly yields the following output :
========================================================================= JBoss Bootstrap Environment JBOSS_HOME: /tmp/space test/wildfly-16.0.0.Final JAVA: /tmp/space test/jdk-11/bin/java JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true ========================================================================= 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)
The problem lies inside bin/common.sh :
setModularJdk() {
$JAVA --add-modules=java.se -version > /dev/null 2>&1 && MODULAR_JDK=true || MODULAR_JDK=false
}
Since the test fails due to the variable being split, the final $JAVA_OPTS misses options such as --add-modules=java.se.
The $JAVA variable can be quoted to fix the problem :
setModularJdk() {
"$JAVA" --add-modules=java.se -version > /dev/null 2>&1 && MODULAR_JDK=true || MODULAR_JDK=false
}