jboss-cli.sh does not work on Amazon Linux 2

270 views
Skip to first unread message

Osman Balci

unread,
Feb 12, 2021, 4:24:48 PM2/12/21
to WildFly
I was able to configure the WildFly's Undertow subsystem locally on my iMac by using jboss-cli.sh without any problem.
However, I cannot make jboss-cli.sh work on my AWS EC2 instance running Amazon Linux 2. WildFly runs the 3 apps that I have deployed so far with no problem.
Here is the the problem:
[ec2-user@ip-172-31-18-211 bin]$ cd /opt/wildfly/bin
[ec2-user@ip-172-31-18-211 bin]$ ./jboss-cli.sh -c
./jboss-cli.sh: line 85: /usr/lib/jvm/java-11-openjdk-11.0.7.10-4.amzn2.0.1.x86_64/bin/java/bin/java: Not a directory
./jboss-cli.sh: line 85: exec: /usr/lib/jvm/java-11-openjdk-11.0.7.10-4.amzn2.0.1.x86_64/bin/java/bin/java: cannot execute: Not a directory

jboss-cli.sh file:
    84 if [ "x$LOG_CONF" = "x" ]; then
    85     exec "$JAVA" $JAVA_OPTS -Dlogging.configuration=file:"$JBOSS_HOME"/bin/jboss-cli-logging.properties -jar "$JBOSS_HOME"/jboss-modules.jar -mp "${JBOSS_MODULEPATH}" org.jboss.as.cli "$@"
    86 else
    87     echo "logging.configuration already set in JAVA_OPTS"
    88     exec "$JAVA" $JAVA_OPTS -jar "$JBOSS_HOME"/jboss-modules.jar -mp "${JBOSS_MODULEPATH}" org.jboss.as.cli "$@"
    89 fi

[ec2-user@ip-172-31-18-211 bin]$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-11.0.7.10-4.amzn2.0.1.x86_64/bin/java

[ec2-user@ip-172-31-18-211 bin]$ echo $PATH
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/lib/jvm/jdk-15.0.1/bin:/usr/lib/jvm/java-11-openjdk-11.0.7.10-4.amzn2.0.1.x86_64/bin/java/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/lib/jvm/java-11-openjdk-11.0.7.10-4.amzn2.0.1.x86_64/bin/java/bin

[ec2-user@ip-172-31-18-211 bin]$ java -version
openjdk version "11.0.7" 2020-04-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode, sharing)
[ec2-user@ip-172-31-18-211 bin]$ 

Your help to resolve this issue will be much appreciated!

Jean Francois Denise

unread,
Feb 12, 2021, 4:37:39 PM2/12/21
to wil...@googlegroups.com
You should unset JAVA_HOME or set it to /usr/lib/jvm/java-11-openjdk-11.0.7.10-4.amzn2.0.1.x86_64/
--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/707d3f6c-1de6-431c-8516-1a07d8206492n%40googlegroups.com.


Osman Balci

unread,
Feb 12, 2021, 5:12:59 PM2/12/21
to WildFly
THANK YOU!!!

$ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.7.10-4.amzn2.0.1.x86_64/

$ export PATH=$PATH:$JAVA_HOME/bin

Solved the problem!
Reply all
Reply to author
Forward
0 new messages