set main class as entry point

This commit is contained in:
fszimnau
2025-11-19 10:49:01 +01:00
parent 3929ce2666
commit 5a596e28da
2 changed files with 7 additions and 3 deletions

View File

@@ -6,4 +6,8 @@ if [[ ! -e dist ]]; then
mkdir dist;
fi
rm -r dist/* 2>/dev/null;
jar cf ../dist/zeitlaeufer.jar target/**/*;
dir=$(pwd)
cd target;
# --create --file <=> cf
jar --create --file=../dist/zeitlaeufer.jar --main-class=de.szimnau.zeitlaeufer.Main ./**/*;
cd $dir

View File

@@ -3,12 +3,12 @@ set -uo pipefail
# when executed as executable file in "git for windows" bash some things won't work, so always run with prefixed command
originDir=$(pwd);
cd ~/zeitlaeufer/;
cd /g/zeitlaeufer/;
tmpDir="/tmp/zeitlaeufer_$RANDOM";
mkdir $tmpDir;
cp dist/zeitlaeufer.jar $tmpDir;
cd $originDir;
# java -cp $tmpDir/zeitlaeufer.jar $@;
# -p <=> --module-path | -m <=> --module
java --module-path $tmpDir/zeitlaeufer.jar --module zeitlaeufer/$@;
java --module-path $tmpDir/zeitlaeufer.jar --module zeitlaeufer $@;
rm -r $tmpDir;