[
https://issues.jboss.org/browse/WFCORE-4503?page=com.atlassian.jira.plugi...
]
James Perkins commented on WFCORE-4503:
---------------------------------------
I moved this from
https://issues.jboss.org/browse/WFLY-12126 which is what the commit
references. I missed the WFLY JIRA referenced in the commit before I merged it.
A space in $JAVA path causes bad MODULAR_JDK resolution
-------------------------------------------------------
Key: WFCORE-4503
URL:
https://issues.jboss.org/browse/WFCORE-4503
Project: WildFly Core
Issue Type: Bug
Components: Scripts
Environment: Linux, but it should happen in any environment that uses the bash
scripts.
I believe it affects all versions of wildly that started supporting the modular JDK.
Reporter: George Trudeau
Assignee: Jaikiran Pai
Priority: Major
Fix For: 9.0.0.Beta8
When a user setup a JDK in a path containing a space, wildfly yields the following output
:
{code}
=========================================================================
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)
{code}
The problem lies inside {{bin/common.sh}} :
{code:sh}
setModularJdk() {
$JAVA --add-modules=java.se -version > /dev/null 2>&1 &&
MODULAR_JDK=true || MODULAR_JDK=false
}
{code}
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 :
{code:sh}
setModularJdk() {
"$JAVA" --add-modules=java.se -version > /dev/null 2>&1 &&
MODULAR_JDK=true || MODULAR_JDK=false
}
{code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)