neilcsmith-net commented on code in PR #8725:
URL: https://github.com/apache/netbeans/pull/8725#discussion_r2284909009


##########
platform/o.n.bootstrap/launcher/unix/nbexec:
##########
@@ -157,16 +157,24 @@ if [ -z "$jdkhome" ] ; then
                 jdkhome="/Library/Internet 
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"
             fi
             ;;
-            *) javac=`which javac`
-            if [ -z "$javac" ] ; then
-                java=`which java`
-                if [ ! -z "$java" ] ; then
-                    java=`resolve_symlink "$java"`
-                    jdkhome=`dirname $java`"/.."
-                fi
+            *)
+            if [ "x" != "x${JAVA_HOME}" -a -x "${JAVA_HOME}/bin/java" ]; then

Review Comment:
   > The `"x" != "x${JAVA_HOME}"` idiom is used quite frequently, it is only 
true if the variable is set and is not zero length.
   
   Sure, and as I understand it the historic form of `-n`.  Mind you, again 
checking the rest of this file for consistency, we seem to use the pattern `[ ! 
-z "${JAVA_HOME}" ]` elsewhere in it.
   
   > The rest of the java detection code checks to see if a java executable is 
present, I copied that.
   
   Yes, and if you let it fall through it should hit that check and exit.



-- 
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

Reply via email to