This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 162518

Summary: Launcher should use the user default java
Product: platform Reporter: Yulia Novozhilova <ynov>
Component: Launchers&CLIAssignee: t_h <t_h>
Status: VERIFIED FIXED    
Severity: blocker CC: dlipin, olangr, pjiricka
Priority: P3    
Version: 6.x   
Hardware: Macintosh   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 159846    
Attachments: get_user_jdk_for_MacOSX.sh
patch for nbexec
Corrected nbexec.patch

Description Yulia Novozhilova 2009-04-13 16:14:23 UTC
Please, correct nbexec script. Currently jdkhome is set to /System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
for Mac OS X by default. 

-----------------nbexec------------
   case "`uname`" in
        Darwin*)
        if [ -x /System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java ] ; then
            jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
        fi
        ;;
...
-----------------------------------
 
But it should check what the user default is and use that (often on Mac OS X Leopard users use jdk 6.0.* as default).
It is impossible to determine from Mac native installer what java is used by the user, so nbexec must take care of that.
Attached script can be used in nbexec (after "Darwin*)") for jdkhome set-up.
Comment 1 Yulia Novozhilova 2009-04-13 16:17:11 UTC
Created attachment 79986 [details]
get_user_jdk_for_MacOSX.sh
Comment 2 Yulia Novozhilova 2009-04-24 09:10:52 UTC
I've prepared a patch for nbexec (attached) to fix this issue. Could you please review. If everything is ok I will push
the changes into main asap.
Comment 3 Yulia Novozhilova 2009-04-24 09:12:54 UTC
Created attachment 80824 [details]
patch for nbexec
Comment 4 Yulia Novozhilova 2009-04-24 13:19:22 UTC
Created attachment 80846 [details]
Corrected nbexec.patch
Comment 5 Yulia Novozhilova 2009-04-24 13:21:06 UTC
Patch is corrected 1.5. --> 1.6.0 in line: 
if [ $? -eq 0 ] && [ -n "`echo \"$java_version\" | grep 1.5.0`" ] ; then  --> 
if [ $? -eq 0 ] && [ -n "`echo \"$java_version\" | grep 1.6.0`" ] ; then

Comment 6 t_h 2009-04-28 10:53:21 UTC
Patch seems OK, please integrate.
Comment 7 t_h 2009-04-28 10:53:54 UTC
*** Issue 163859 has been marked as a duplicate of this issue. ***
Comment 8 Yulia Novozhilova 2009-04-28 13:55:20 UTC
Thanks for review.
Fixed: http://hg.netbeans.org/main/rev/b0b443fbbbc0
Comment 9 Petr Jiricka 2009-04-29 08:36:15 UTC
Thanks, works for me now.