Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More on NetBeans failure to start



Hi Gary,

My understanding based on using Netbeans 6.1 is that the jdk used by netbeans is defined in the file:

/Applications/NetBeans/NetBeans 6.1.app/Contents/Resources/NetBeans/ etc/netbeans.conf

I would assume that Netbeans 6.5 uses the same approach but have not confirmed this. Running netbeans from the dock or launching manually should ultimately startup netbeans using the jdk defined in this file.

On my system this file contains the following definition for netbeans_jdkhome. Note there are other properties defined.

# Default location of JDK, can be overridden by using --jdkhome <dir>:
netbeans_jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/ 1.5/Home


Switching between JDK's to run the ide in means changing this file.

I'm not sure how this conf file gets originally setup but am presuming it is done so during installation of Netbeans. I don't know how it selects the java to use.

This conf file also has a property named netbeans_default_options. If you need to alter some of the parameters passed to java / netbeans on startup, this would be the property to try modifying.

What jdk is the netbeans.conf file pointing to on your system?

I've been able to successfully switch between running the ide using netbeans_jdkhome set at 1.5 and 1.6. When running using 1.5, the default on my system is the 32 version. When I added -d64 to the netbeans_default_options I can force it to start in 64bit 1.5 mode.

If you can capture the exact command being issued on your system it might be helpful.

In the nbexec file add the following just before the eval statement you posted:

echo "netbeansstartup data" > $HOME/jvmstartupinfo.txt
echo "JDKHOME:" >> $HOME/jvmstartupinfo.txt
echo ${jdkhome} >>  $HOME/jvmstartupinfo.txt
echo "CP:" >> $HOME/jvmstartupinfo.txt
echo $cp >> $HOME/jvmstartupinfo.txt
echo "JARGS:" >> $HOME/jvmstartupinfo.txt
echo $jargs  >> $HOME/jvmstartupinfo.txt
echo "ARGS:" >> $HOME/jvmstartupinfo.txt
echo $args  >> $HOME/jvmstartupinfo.txt

This creates the file jvmstartupinfo.txt in $HOME. If you post your results I can try the exact same startup logic on my system and also a couple of other architecture variants.


Bob Potterveld

On Sep 26, 2008, at 8:48 PM, Gary Nunes wrote:

Greg,

Thanks for the continued help.


Greg Guerin wrote (9/26/08 5:30 PM):


If that's the info from the Terminal-launched NetBeans, then it's running in 32-bit mode. I infer this from the "running on i386", which is the 32-bit Intel architecture. If it were running 64-bit, it would be "running on x86_64".

I'm guessing that it's not the info from the Finder-launched
NetBeans, because it apparently crashes before it can ever get to the
point of offering you an About box.


Thanks for the tip on recognizing the modes.

As you inferred, the About Dialog info is from the Terminal launch (sorry I
forgot to mention that).


The console message at the bottom of the previous post is from the Finder
Launch (which I think I did indicate). The console output is, I think, the
result of the execution of the shell script that resides in the NetBeans
bundle. As mentioned it contains no option to run in 64-bit mode. Nor does
the App bundle or my system itself.




I drew the correlation between crashing and 64-bit simply by reading
the crash-log you linked to:

...

How it got to be running as 64-bit, I couldn't begin to guess.  You'd
have to look at the shell script that NetBeans seems to have as its
primary CFBundleExecutable.  I say "seems to have" because I'm
inferring this from a comment in the bug-report URL that says "The
start up script inside Netbeans.app is a .sh script ..."


That's the $64K question. I have looked at the script and, with my rusty
shell script skills and its complexity, I can't claim to understand it that
well. It looks like the shell script named netbeans is initially called and,
ultimately, references another script called nbexec (just as complicated).
nbexec has no obvious 64-bit mode setting statements. nbexec, in turn,
invokes the java command, seen in the console message, and also returns the
line 466 error. Line 466 is inside a while loop in nbexec. In the loop
various variables are initialized and, eventually, we get to:


  ...
eval ${_NB_PROFILE_CMD} "\"${jdkhome}/bin/java\""
-Djdk.home="\"${jdkhome}\"" -classpath "\"$cp\"" \
       $jargs org.netbeans.Main "$args" '&'
PID=$!
trap "kill $PID" EXIT
wait $PID
exitcode=$?
trap '' EXIT
  ...

Line 466 is the
   wait $PID
line.



...

A given process is either 32-bit or 64-bit: it can't switch between
modes.  However, a 32-bit process can start a 64-bit process, or vice
versa.  So in the general sense, yes, it's possible that some part is
executing 64-bit code while another part is executing 32-bit code.
You'll have to ask a more specific question, and you'd probably have
to ask it of the product provider (Sun or Jetbrains, as appropriate).


I will add elements of this discussion to both the NetBeans and Apple bug
reports. I think you may have something in surmising that running in 64-bit
mode is the problem. The question then is, what's causing the app to run in
64-bit mode on an apparently small subset of machines (or possibly why is
that a problem on such machines)?




Some bundled apps on Leopard give you the choice, using Finder's Get
Info window, to run the app as 64-bit or 32-bit.  Do a Get Info on /
Applications/Chess.app and you'll see a checkbox for "Open in 32-bit
mode".  If an app has only 64-bit or only 32-bit code, the checkbox
will be absent.  For example, look at TextEdit.app.


There's no check box for either the NetBeans or IDEA app.




...

... it could still
be running as 64-bit (or 32-bit) based on the contents of its startup
shell script.  You'll have to dig into NB.app to find out.  It's
probably near line 466, if the crash message is to be believed.


Tried to, in my limited way (as mentioned above).


Anyway, I appreciate the help and you may have solved part of the mystery
(maybe the why if not the how).


Regards,
   gary


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: More on NetBeans failure to start (From: Gary Nunes <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.