Created
July 22, 2024 13:36
-
-
Save Martinligabue/505b4e5a5c3a08717fa15dfb2e9ce6f6 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# ----------------------------------------------------------------------------- | |
# Copyright 2015 the original author or authors. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# ----------------------------------------------------------------------------- | |
# ########################################################################## | |
# | |
# decima startup script for Linux | |
# | |
# ########################################################################## | |
# Set local scope for the variables | |
DIRNAME=$(dirname "$0") | |
[ "$DIRNAME" = "" ] && DIRNAME=. | |
APP_BASE_NAME=$(basename "$0") | |
APP_HOME=$(cd "$DIRNAME" && pwd) | |
# Add default JVM options here. You can also use JAVA_OPTS and DECIMA_OPTS to pass JVM options to this script. | |
DEFAULT_JVM_OPTS="--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED" | |
# Find java | |
if [ -z "$JAVA_HOME" ]; then | |
JAVA_EXE=java | |
if ! command -v $JAVA_EXE &> /dev/null; then | |
echo | |
echo "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH." | |
echo | |
echo "Please set the JAVA_HOME variable in your environment to match the" | |
echo "location of your Java installation." | |
exit 1 | |
fi | |
else | |
JAVA_HOME=${JAVA_HOME//\"/} | |
JAVA_EXE="$JAVA_HOME/bin/java" | |
if [ ! -x "$JAVA_EXE" ]; then | |
echo | |
echo "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME" | |
echo | |
echo "Please set the JAVA_HOME variable in your environment to match the" | |
echo "location of your Java installation." | |
exit 1 | |
fi | |
fi | |
# Setup the classpath | |
CLASSPATH="$APP_HOME/lib/decima-0.1.24.jar:$APP_HOME/lib/decima-ext-model-exporter.jar:$APP_HOME/lib/decima-ext-model-viewer.jar:$APP_HOME/lib/decima-ext-texture-viewer.jar:$APP_HOME/lib/bundle-lwjgl.jar:$APP_HOME/lib/decima-ext-shader-viewer.jar:$APP_HOME/lib/decima-ui.jar:$APP_HOME/lib/platform-ui.jar:$APP_HOME/lib/decima-model.jar:$APP_HOME/lib/platform-model.jar:$APP_HOME/lib/logback-classic-1.4.4.jar:$APP_HOME/lib/lwjgl-opengl-3.3.2.jar:$APP_HOME/lib/lwjgl-opengl-3.3.2-natives-windows.jar:$APP_HOME/lib/lwjgl-opengl-3.3.2-natives-linux.jar:$APP_HOME/lib/joml-1.10.5.jar:$APP_HOME/lib/lwjgl3-awt-0.1.8.jar:$APP_HOME/lib/lwjgl-jawt-3.3.2.jar:$APP_HOME/lib/lwjgl-3.3.2-natives-windows.jar:$APP_HOME/lib/lwjgl-3.3.2-natives-linux.jar:$APP_HOME/lib/lwjgl-3.3.2.jar:$APP_HOME/lib/gson-2.10.jar:$APP_HOME/lib/reflections-0.10.2.jar:$APP_HOME/lib/miglayout-swing-11.0.jar:$APP_HOME/lib/flatlaf-extras-3.4.jar:$APP_HOME/lib/flatlaf-3.4.jar:$APP_HOME/lib/jna-5.12.1.jar:$APP_HOME/lib/picocli-4.7.0.jar:$APP_HOME/lib/tinybcdec-0.1.1.jar:$APP_HOME/lib/logback-core-1.4.4.jar:$APP_HOME/lib/slf4j-api-2.0.1.jar:$APP_HOME/lib/javassist-3.28.0-GA.jar:$APP_HOME/lib/jsr305-3.0.2.jar:$APP_HOME/lib/miglayout-core-11.0.jar:$APP_HOME/lib/jsvg-1.2.0.jar" | |
# Execute decima | |
"$JAVA_EXE" $DEFAULT_JVM_OPTS $JAVA_OPTS $DECIMA_OPTS -classpath "$CLASSPATH" com.shade.platform.Launcher "$@" | |
# Capture exit code | |
EXIT_CODE=$? | |
# Exit with the same code | |
exit $EXIT_CODE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment