-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use shell scripts for launching tools
- Loading branch information
1 parent
be9df73
commit bb81e1d
Showing
4 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
SCRIPT_PATH="$(dirname "$(realpath -s "$0")")" | ||
SCRIPT_NAME="$(basename "$(realpath -s "$0")")" | ||
SCRIPT_BASE="$(basename -s .sh "$SCRIPT_NAME")" | ||
JAR_NAME="$SCRIPT_BASE.jar" | ||
JDK_DIR="$(realpath "$SCRIPT_PATH/../jdk/bin/java")" | ||
|
||
echo "SCRIPT_PATH: $SCRIPT_PATH" | ||
echo "SCRIPT_NAME: $SCRIPT_NAME" | ||
echo "SCRIPT_BASE: $SCRIPT_BASE" | ||
echo "JAR_NAME: $JAR_NAME" | ||
echo "JDK_DIR: $JDK_DIR" | ||
|
||
if ! "$JDK_DIR" -jar "$JAR_NAME"; then | ||
echo "ERROR launching $SCRIPT_BASE using $JDK_DIR" | ||
if ! "$JAVA_HOME/bin/java" -jar "$JAR_NAME"; then | ||
echo "ERROR launching $SCRIPT_BASE using $JAVA_HOME" | ||
if ! java -jar "$JAR_NAME"; then | ||
echo "ERROR launching $SCRIPT_BASE using java from path: $PATH" | ||
fi | ||
fi | ||
fi |