From 435a88cfaa1ab9dbf3553666b32c6c2425098b18f75f73c241716806402aa7d5 Mon Sep 17 00:00:00 2001 From: Minimons Date: Tue, 16 Jun 2026 10:08:53 +0200 Subject: [PATCH] Add debug.sh script --- debug.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 debug.sh diff --git a/debug.sh b/debug.sh new file mode 100755 index 0000000..f39db2a --- /dev/null +++ b/debug.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -euo pipefail + +shopt -s nullglob + +jars=(libs/*.jar) +if (( ${#jars[@]} == 0 )); then + echo "ERROR: No JARs found in libs/" >&2 + exit 1 +fi + +CLASSPATH=$(IFS=:; echo "${jars[*]}") + +DEBUG_PORT="${DEBUG_PORT:-5005}" +DEBUG_SUSPEND="${DEBUG_SUSPEND:-y}" + +echo "Starting NenjimHub in DEBUG mode on port ${DEBUG_PORT} (suspend=${DEBUG_SUSPEND})" + +exec java \ + "-agentlib:jdwp=transport=dt_socket,server=y,suspend=${DEBUG_SUSPEND},address=*:${DEBUG_PORT}" \ + -Dlog4j.configurationFile=conf/log4j2.xml \ + -cp "$CLASSPATH" \ + com.r35157.nenjim.hubd.impl.ref.Main