GP-6350: You can now set PyGhidra Java options via an assortment of

environment variables (Closes #8942)
This commit is contained in:
Ryan Kurtz
2026-02-09 06:13:26 -05:00
parent 6fa9d69ee6
commit 7525f3c4be
2 changed files with 10 additions and 4 deletions
@@ -11,8 +11,11 @@
SCRIPT_FILE="$(readlink -f "$0" 2>/dev/null || readlink "$0" 2>/dev/null || echo "$0")"
SCRIPT_DIR="${SCRIPT_FILE%/*}"
# Add optional JVM args inside the quotes
VMARG_LIST=""
# Since JPype doesn't seem to pick up JDK_JAVA_OPTIONS automatically, include it ourselves
VMARG_LIST="${JDK_JAVA_OPTIONS}"
# Apply Java options from externally set environment variables
VMARG_LIST="${VMARG_LIST} ${GHIDRA_JAVA_OPTIONS} ${PYGHIDRA_JAVA_OPTIONS}"
# Make sure Python3 is installed
if ! [ -x "$(command -v python3)" ] ; then
@@ -22,8 +22,11 @@ setlocal enabledelayedexpansion
set DOUBLE_CLICKED=n
for /f "tokens=2" %%# in ("%cmdcmdline%") do if /i "%%#" equ "/c" set DOUBLE_CLICKED=y
:: Add optional JVM args inside the quotes
set VMARG_LIST=-Dsun.java2d.dpiaware=true
:: Since JPype doesn't seem to pick up JDK_JAVA_OPTIONS automatically, include it ourselves
set VMARG_LIST=%JDK_JAVA_OPTIONS%
:: Apply Java options from externally set environment variables
set VMARG_LIST=%VMARG_LIST% %GHIDRA_JAVA_OPTIONS% %PYGHIDRA_JAVA_OPTIONS% -Dsun.java2d.dpiaware=true
:: Make sure Python3 is installed
set PYTHON=py