neilcsmith-net commented on code in PR #9425:
URL: https://github.com/apache/netbeans/pull/9425#discussion_r3349698834
##########
platform/o.n.bootstrap/launcher/unix/nbexec:
##########
@@ -154,21 +154,37 @@ if [ -z "$jdkhome" ] ; then
# try to find JDK
case "`uname`" in
Darwin*)
- # check if JAVA_HOME is empty string since java_home will return
the value of JAVA_HOME
- if [ -z "$JAVA_HOME" ]; then
- unset JAVA_HOME
- fi
- # read Java Preferences
- if [ -x "/usr/libexec/java_home" ]; then
- jdkhome=`/usr/libexec/java_home --version 1.8+`
- # JDK1.8 as a fallback
- elif [ -f
"/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java" ] ; then
-
jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home"
- fi
-
- # JRE fallback
- if [ ! -x "${jdkhome}/bin/java" -a -f "/Library/Internet
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" ] ; then
- jdkhome="/Library/Internet
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"
+ # check if JAVA_HOME is empty string
+ if [ ! -z "$JAVA_HOME" ]; then
+ jdkhome="${JAVA_HOME}"
Review Comment:
I would be tempted to move this statement before the check for sdkman, and
remove from inside both case options, which would also allow removing an
if/else level. I think `JAVA_HOME` should take precedence over sdkman, but
could go after it if others disagree. Also can remove the comment, or change
to "use JAVA_HOME if set"?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists