$OpenBSD: patch-Ghidra_RuntimeScripts_Linux_support_launch_sh,v 1.1 2019/07/23 02:09:20 lteo Exp $

Index: Ghidra/RuntimeScripts/Linux/support/launch.sh
--- Ghidra/RuntimeScripts/Linux/support/launch.sh.orig
+++ Ghidra/RuntimeScripts/Linux/support/launch.sh
@@ -89,13 +89,13 @@ else
 fi
 
 # Make sure some kind of java is on the path.  It's required to run the LaunchSupport program.
-if ! [ -x "$(command -v java)" ] ; then
+if ! [ -x "$(javaPathHelper -c ghidra)" ] ; then
 	echo "Java runtime not found.  Please refer to the Ghidra Installation Guide's Troubleshooting section."
 	exit 1
 fi
 
 # Get the JDK that will be used to launch Ghidra
-JAVA_HOME="$(java -cp "${LS_CPATH}" LaunchSupport "${INSTALL_DIR}" -jdk_home -save)"
+JAVA_HOME="$(javaPathHelper -h ghidra)"
 if [ ! $? -eq 0 ]; then
 	# No JDK has been setup yet.  Let the user choose one.
 	java -cp "${LS_CPATH}" LaunchSupport "${INSTALL_DIR}" -jdk_home -ask
@@ -111,7 +111,7 @@ fi
 JAVA_CMD="${JAVA_HOME}/bin/java"
 
 # Get the configurable VM arguments from the launch properties
-VMARG_LIST+=" $(java -cp "${LS_CPATH}" LaunchSupport "${INSTALL_DIR}" -vmargs)"
+VMARG_LIST+=" $("${JAVA_CMD}" -cp "${LS_CPATH}" LaunchSupport "${INSTALL_DIR}" -vmargs)"
 
 # Add extra macOS VM arguments
 if [ "$(uname -s)" = "Darwin" ]; then
