Newbie question re "/usr/bin/java/bin/java not found"

93 views
Skip to first unread message

Ken Peirce

unread,
Apr 10, 2024, 10:53:40 AM4/10/24
to WildFly
Hi WildFliers,

I am installing WildFly 26 and OpenJDK11 on Ubuntu 22.04 LTS with latest updates. I am trying to create an Elytron credential store.

This command, using a bash shell, results in the error shown.
sudo /opt/wildfly/bin/jboss-cli.sh --connect '/subsystem=elytron/credential-store=defaultCS:add(location=keystore/credentials, relative-to=jboss.server.config.dir, credential-reference={clear-text="{EXT}/usr/bin/wildfly_pass", type="COMMAND"}, create=true)'

/opt/wildfly/bin/jboss-cli.sh: 88: exec: /usr/bin/java/bin/java: not found

echo $JAVA_HOME show it to equal to /usr/bin/java

This same error is thrown for any jboss-cli.sh --connect attempts.
When I run "systemctl status wildfly", I see this:

  wildfly.service - The WildFly Application Server
     Loaded: loaded (/etc/systemd/system/wildfly.service; disabled; vendor pres>
     Active: active (running) since Wed 2024-04-10 09:27:03 EDT; 19s ago
   Main PID: 5657 (launch.sh)
      Tasks: 107 (limit: 9339)
     Memory: 410.6M
        CPU: 19.673s
     CGroup: /system.slice/wildfly.service
             ├─5657 /bin/bash /opt/wildfly/bin/launch.sh standalone standalone.>
             ├─5658 /bin/sh /opt/wildfly/bin/standalone.sh -c standalone.xml -b>
             └─5781 java "-D[Standalone]" -server -Xms2048m -Xmx2048m -XX:Metas>
The vendor preset (not visible here) is set to active

Q1: Is WildFly actually running, or is it disabled?
Q2: Any ideas why this error is being thrown?  

Cheers,
Ken

Bartosz Baranowski

unread,
Apr 11, 2024, 2:21:19 AM4/11/24
to WildFly
JAVA_HOME should point to where JDK/JVM is installed not bin directory.  For instance, on my drone I get following result - for any JVM I choose from alternatives.
/usr/bin$ ll | grep java
lrwxrwxrwx  1 root     root        22 paź 13  2020 java -> /etc/alternatives/java*
lrwxrwxrwx  1 root     root        29 lut  9  2021 java2groovy -> /etc/alternatives/java2groovy*
lrwxrwxrwx  1 root     root        23 paź 14  2020 javac -> /etc/alternatives/javac*

In my startup script I read current JDK home with
readlink -f /usr/bin/java | sed -e 's/\/bin\/java//' | sed -e 's/\/jre//'
which currently resolves to: 
/usr/lib/jvm/java-1.18.0.1.1

Emmanuel Hugonnet

unread,
Apr 15, 2024, 3:11:13 AM4/15/24
to Ken Peirce, WildFly
JAVA_HOME should point to the JDK installation path and not to the java binary.
It should be something like "/usr/lib/jvm/default-java"  I think (not having an Ubuntu OS I don't havethe mean to verify that path).
Cheers,
Emmanuel
> --
> 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/2593cbb8-4a79-4562-a3cf-f0a2e38c0ee1n%40googlegroups.com
> <https://groups.google.com/d/msgid/wildfly/2593cbb8-4a79-4562-a3cf-f0a2e38c0ee1n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Ken Wills

unread,
Apr 15, 2024, 3:12:01 AM4/15/24
to Ken Peirce, WildFly
Hi Ken,

On Wed, Apr 10, 2024 at 9:53 AM Ken Peirce <ken.p...@gmail.com> wrote:
Hi WildFliers,

I am installing WildFly 26 and OpenJDK11 on Ubuntu 22.04 LTS with latest updates. I am trying to create an Elytron credential store.

This command, using a bash shell, results in the error shown.
sudo /opt/wildfly/bin/jboss-cli.sh --connect '/subsystem=elytron/credential-store=defaultCS:add(location=keystore/credentials, relative-to=jboss.server.config.dir, credential-reference={clear-text="{EXT}/usr/bin/wildfly_pass", type="COMMAND"}, create=true)'

/opt/wildfly/bin/jboss-cli.sh: 88: exec: /usr/bin/java/bin/java: not found

echo $JAVA_HOME show it to equal to /usr/bin/java

JAVA_HOME is set to the parent directory that java is installed to, so in your case JAVA_HOME=/usr

Ken
 

This same error is thrown for any jboss-cli.sh --connect attempts.
When I run "systemctl status wildfly", I see this:

  wildfly.service - The WildFly Application Server
     Loaded: loaded (/etc/systemd/system/wildfly.service; disabled; vendor pres>
     Active: active (running) since Wed 2024-04-10 09:27:03 EDT; 19s ago
   Main PID: 5657 (launch.sh)
      Tasks: 107 (limit: 9339)
     Memory: 410.6M
        CPU: 19.673s
     CGroup: /system.slice/wildfly.service
             ├─5657 /bin/bash /opt/wildfly/bin/launch.sh standalone standalone.>
             ├─5658 /bin/sh /opt/wildfly/bin/standalone.sh -c standalone.xml -b>
             └─5781 java "-D[Standalone]" -server -Xms2048m -Xmx2048m -XX:Metas>
The vendor preset (not visible here) is set to active

Q1: Is WildFly actually running, or is it disabled?
Q2: Any ideas why this error is being thrown?  

Cheers,
Ken

--
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.
Reply all
Reply to author
Forward
0 new messages