0%

Mac JD-GUI 无法打开

M2 Mac 安装 JD-GUI 无法打开:

ERROR launching 'JD-GUI'

No suitable Java version found on your system!
This program requires Java 1.8+
Make sure you install the required Java version.

解决方案:

文本编辑器打开 /Applications/JD-GUI.app/Contents/MacOS/universalJavaApplicationStub.sh

找到 JAVACMD 赋值的地方:

# first check system variable "$JAVA_HOME" -> has precedence over any other System JVM
stub_logger '[JavaSearch] Checking for $JAVA_HOME ...'
if [ -n "$JAVA_HOME" ] ; then
stub_logger "[JavaSearch] ... found JAVA_HOME with value $JAVA_HOME"

# PR 26: Allow specifying "$JAVA_HOME" relative to "$AppPackageFolder"
# which allows for bundling a custom version of Java inside your app!
if [[ $JAVA_HOME == /* ]] ; then
# if "$JAVA_HOME" starts with a Slash it's an absolute path
JAVACMD="$JAVA_HOME/bin/java"
else
# otherwise it's a relative path to "$AppPackageFolder"
JAVACMD="$AppPackageFolder/$JAVA_HOME/bin/java"
fi
JAVACMD_version=$(get_comparable_java_version $(get_java_version_from_cmd "${JAVACMD}"))
else
stub_logger "[JavaSearch] ... didn't found JAVA_HOME"
fi

直接写死成Java 1.8的路径:

JAVACMD="/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java"

注意后面的 bin/java