From 7e41892cd0e6523d914e080445c9405d64f238c2 Mon Sep 17 00:00:00 2001 From: Piers Uso Walter <21985670+pierswalter@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:56:08 +0100 Subject: [PATCH] This change fixes a problem that prevents JD-GUI.app from starting on my Mac (macOS Big Sur): /usr/libexec/java_home does not support the combination of -F and -v if the version string contains a plus (as it does here since $JVMVersion is set to "1.8+" in Info.plist). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When this is called, the following error message appears: The operation couldn’t be completed. Unable to locate a Java Runtime that supports (null). Please visit http://www.java.com for information on installing Java. (there would be no error if $JVMVersion would be "1.8" for example) --- src/osx/resources/universalJavaApplicationStub.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osx/resources/universalJavaApplicationStub.sh b/src/osx/resources/universalJavaApplicationStub.sh index 686db22d..3e596e0f 100644 --- a/src/osx/resources/universalJavaApplicationStub.sh +++ b/src/osx/resources/universalJavaApplicationStub.sh @@ -228,7 +228,7 @@ if [ -n "$JAVA_HOME" ] ; then # check for specified JVMversion in "/usr/libexec/java_home" symlinks elif [ ! -z ${JVMVersion} ] && [ -x /usr/libexec/java_home ] && /usr/libexec/java_home -F; then - if /usr/libexec/java_home -F -v ${JVMVersion}; then + if /usr/libexec/java_home -v ${JVMVersion} 2> /dev/null; then JAVACMD="`/usr/libexec/java_home -F -v ${JVMVersion} 2> /dev/null`/bin/java" else # display error message with applescript