blob: 66eba1ea54d659e600df4df6fc3fd4c166d6f774 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/bin/sh
set -eu
if [ "${1:-}" != -p ]; then
WORKDIR=${XDG_CONFIG_HOME:-$HOME/.config}/hmcl
mkdir -p "$WORKDIR"
cd "$WORKDIR"
fi
JAVA_HOME=$(pacman -Ql java-runtime | grep -e '/usr/lib/jvm/.*/bin/java$' | head -n 1 | cut -s -d ' ' -f '2-' | cut -s -d / -f '-5')
JAVAFX_HOME=$(dirname "$(pacman -Ql java-openjfx | grep -e '/javafx\..*\.jar$' | head -n 1 | cut -s -d ' ' -f '2-')")
exec "${JAVA_HOME}"/bin/java \
--module-path "${JAVAFX_HOME}/javafx.base.jar:${JAVAFX_HOME}/javafx.fxml.jar:${JAVAFX_HOME}/javafx.graphics.jar:${JAVAFX_HOME}/javafx.media.jar:${JAVAFX_HOME}/javafx.swing.jar:${JAVAFX_HOME}/javafx.web.jar:${JAVAFX_HOME}/javafx.controls.jar" \
--add-modules=javafx.base --add-modules=javafx.fxml --add-modules=javafx.graphics --add-modules=javafx.media --add-modules=javafx.swing --add-modules=javafx.web --add-modules=javafx.controls \
-jar /usr/share/java/hmcl-new/hmcl-new.jar \
"$@"
|