SQL Workbench/J Git Repository https://www.sql-workbench.eu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
1003 B

#!/usr/bin/env bash
# Start SQL Workbench/J in console mode
function readlink() {
case `uname -s` in
Linux*)
command readlink -e "$@"
;;
*)
command readlink "$@"
;;
esac
}
SCRIPT_PATH=$(dirname -- "$(readlink "${BASH_SOURCE[0]}")")
JAVACMD="java"
if [ -x "$SCRIPT_PATH/jre/bin/java" ]
then
JAVACMD="$SCRIPT_PATH/jre/bin/java"
elif [ -x "$SCRIPT_PATH/jre/Contents/Home/bin/java" ]
then
# MacOS
JAVACMD="$SCRIPT_PATH/jre/Contents/Home/bin/java"
elif [ -x "$WORKBENCH_JDK/bin/java" ]
then
JAVACMD="$WORKBENCH_JDK/bin/java"
elif [ -x "$JAVA_HOME/jre/bin/java" ]
then
JAVACMD="$JAVA_HOME/jre/bin/java"
elif [ -x "$JAVA_HOME/bin/java" ]
then
JAVACMD="$JAVA_HOME/bin/java"
fi
cp="$SCRIPT_PATH/sqlworkbench.jar"
cp="$cp:$SCRIPT_PATH/ext/*"
# For Java 9 and later add
# --add-opens java.base/java.lang=ALL-UNNAMED
"$JAVACMD" -Djava.awt.headless=true \
-Dvisualvm.display.name=SQLWorkbenchJ \
-cp "$cp" workbench.console.SQLConsole "$@"