AsamK / signal-cli

signal-cli provides an unofficial commandline, JSON-RPC and dbus interface for the Signal messenger.
GNU General Public License v3.0
3.17k stars 299 forks source link

Request decoupling of JAVA_HOME from verison used for signal-cli #1563

Closed kobold81 closed 1 month ago

kobold81 commented 1 month ago

Hello,

the server I run signal-cli needs a different java version at JAVA_HOME, so I naturally ran into problems using signal-cli. I woud like the author to adapt the signal-cli script so that the user can either by args or withon the script point to a differnet JAVA_HOME for the singal_cli applicaiton:

quick fix:

I added the following lines to the start of the signal-cli script:

signal_cli_JAVA_HOME=/usr/lib/jvm/jdk-21-oracle-x64

And changed the variables shown in this block to use the custom JAVA_HOME and have a fallback one:

Determine the Java command to use to start the JVM. if [ -n "$signal_cli_JAVA_HOME"] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then

IBM's JDK on AIX uses strange locations for the executables

    JAVACMD=$JAVA_HOME/jre/sh/java
else
    JAVACMD=$signal_cli_JAVA_HOME/bin/java
fi
AsamK commented 1 month ago

You can just start signal-cli with a different JAVA_HOME.

JAVA_HOME=/usr/lib/jvm/jdk-21-oracle-x64 signal-cli