-
Notifications
You must be signed in to change notification settings - Fork 224
Open
Description
Below is a script that I use to download the latest version and run mcaselector. If you would like to use this script you'll need to change the app_path variable and the javamodule_path to JavaFX. There's comments in the script on how I go about getting mcaseletor to run using openjdk-21.
The script will ask to delete any old versions of mcaselector that it finds in the app_path. Answer No to keep any older versions. You can always comment out / remove the for loop if you want to skip this check.
Chunk
#!/usr/bin/env bash
# Script by: FeedTheChunk
# A simple script that will check if we have the latest version of mcaselector
# and execute it.
# If not then
# we will delete the old version(s) and download the latest
# Then execute the latest version of mcaselector.
# Change these two variables to match your system:
app_path="${HOME}/Applications" # Directory where mcaselector lives
javamodule_path="/usr/lib/jvm/java-21-openjdk-amd64/lib"
repo="Querz/mcaselector" # GitHub Repo Name
filename="mcaselector-"
latest_version=$(curl -s https://api.github.com/repos/${repo}/releases/latest \
| grep -oP '"tag_name": "\K(.*)(?=")')
download_url="https://github.com/${repo}/releases/download/${latest_version}\
/mcaselector-${latest_version}.jar"
if [[ -e ${app_path}/${filename}${latest_version}.jar ]]; then
echo "${app_path}/${filename}${latest_version}.jar exists."
echo "Skipping download."
else
# remove all older version of mcaselector
for file in "${app_path}/mcaselector*.jar"; do
if [[ -f "$file" ]]; then
rm -i "$file"
fi
done
# Download the tar.gz file
curl -L -o "${app_path}/mcaselector-${latest_version}.jar" "$download_url"
fi
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# JavaFX
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# JavaFX isn't bundled with openjdk so we must manually install it.
# 1. Download JavaFX from https://gluonhq.com/products/javafx/
# 2. Exact the /lib/ directory, ex. ~/temp/lib
# 2. Copy the /lib directory to openjdk
# sudo cp ~/temp/lib/* /usr/lib/jvm/java-21-openjdk-amd64/lib
# 3. Rename jrt-fs.jar
# sudo mv jrt-fs.jar jrt-fs.jar.disabled
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# run mcaselector
java --module-path "${javamodule_path}" --add-modules ALL-MODULE-PATH \
-jar "${app_path}/mcaselector-2.6.1.jar" &
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels