-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
30 lines (21 loc) · 812 Bytes
/
start.sh
File metadata and controls
30 lines (21 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -e
# Fix JAVA_HOME for Maven
export JAVA_HOME=/opt/java/openjdk
export PATH=$JAVA_HOME/bin:$PATH
APP_PORT=${APP_PORT:-25333}
echo "Building Maven project..."
mvn clean package assembly:single -DskipTests
JAR=$(ls target/*-jar-with-dependencies.jar | head -n 1)
if [ -z "$JAR" ]; then
echo "Error: JAR not found in target/"
exit 1
fi
echo "Starting GatewayServer on port $APP_PORT..."
# JVM options
JVM_OPTIONS="--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.lang.invoke=ALL-UNNAMED \
--add-opens java.base/java.lang.reflect=ALL-UNNAMED \
-Xmx1024m" # You can also include memory options, debugging, etc.
# Run the JAR file with the JVM options
java $JVM_OPTIONS -cp "$JAR" com.parseval.Main "$APP_PORT"