diff --git a/skel_common/backup/auto_update.json b/skel_common/backup/auto_update.json index e30bc5e..99613ba 100644 --- a/skel_common/backup/auto_update.json +++ b/skel_common/backup/auto_update.json @@ -22,7 +22,8 @@ "Added a Validate warning about FTL 1.5.13 for chars outside windows-1252", "Disabled XML escaping when reencoding to ensure invalid chars cause an error", "Changed logging framework to SLF4J/Logback", - "Changed command line parser to picocli" + "Changed command line parser to picocli", + "Made launcher scripts on OSX find java the recommended way" ] }, { diff --git a/skel_common/readme_changelog.txt b/skel_common/readme_changelog.txt index 0acd16d..356c110 100644 --- a/skel_common/readme_changelog.txt +++ b/skel_common/readme_changelog.txt @@ -9,6 +9,7 @@ Changelog - Added a Validate warning about FTL 1.5.13 for chars outside windows-1252 - Changed logging framework to SLF4J/Logback - Changed command line parser to picocli +- Made launcher scripts on OSX find java the recommended way 1.9: - Fixed corrupted civilian sector music in FTL 1.6.1+ diff --git a/skel_unix/modman-cli.sh b/skel_unix/modman-cli.sh index 437a04f..ddf2b40 100644 --- a/skel_unix/modman-cli.sh +++ b/skel_unix/modman-cli.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Get the absolute path to this script's folder. if echo "$0" | awk '{exit(!/^\//);}'; then @@ -8,4 +8,13 @@ else fi cd "${maindir}"; -java -jar modman.jar "$@"; + +java_cmd=$(command -v java); + +# OSX uses a command to decide java's location. +if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME=`/usr/libexec/java_home` + java_cmd=${JAVA_HOME}/bin/java +fi + +${java_cmd} -jar modman.jar "$@"; diff --git a/skel_unix/modman.command b/skel_unix/modman.command index 335d7f2..fdc5b42 100644 --- a/skel_unix/modman.command +++ b/skel_unix/modman.command @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Get the script's name. me=$(basename "$0"); @@ -46,7 +46,20 @@ fi # Finally, the payload. cd "${maindir}"; # - - - -java -jar modman.jar; + +java_cmd=$(command -v java); + +# OSX uses a command to decide java's location. +if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME=`/usr/libexec/java_home` + java_cmd=${JAVA_HOME}/bin/java +fi + +echo ""; +echo "Found java at: ${java_cmd}"; +echo ""; + +${java_cmd} -jar modman.jar; # - - - if [ "${ingui}" = "1" ]; then