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



Ok Gary,

I'd like to focus on something I see in your environment (and echoed in the output of the 'which java' command).

In your PATH variable, you have /Library/Java/Home/bin. This is not a part of my PATH.
In my case, java is taken from /usr/bin/java
Java in /usr/bin is a symbolic link to /System/Library/Frameworks/ JavaVM.framework/Versions/Current/Commands/java


Now if I look in my system, /Library/Java/Home is a symbolic link to / System/Library/Frameworks/JavaVM.framework/Home,
which in turn is a symbolic link to Versions/CurrentJDK/Home (relative to the JavaVM.framwork directory)


Now if I list my JavaVM.framework/Version directory, that contains:
drwxr-xr-x@ 8 root  wheel  272 Sep 24 22:11 A
lrwxr-xr-x  1 root  wheel    1 Sep 24 22:11 Current -> A
lrwxr-xr-x  1 root  wheel    3 Sep 24 22:10 CurrentJDK -> 1.5

So the java I use links to the Commands directory in A, while the java you use links through the CurrentJDK symlink to a specific version.

My guess is that the commands in A are what Apple uses to actually check the current java preferences, and start up the correct version.

So in your case, it would appear that your path is actually cutting out the Apple java launch mechanism, and going directly to a specific version.

In the case of IntelliJ IDEA (I use it myself), they use an Apple launcher/stub, which probably avoids using these environment settings.
For NetBeans, these script constructs seem more likely to run into these environmental problems.
For IDEA compilations, javac is launched externally via Runtime.exec().


My guess is that these scripts may be combining incorrect library versions with the java command invoked, causing the crash.


It might help if you eliminate both the JAVA_HOME environment variable (I don't have it, and I have run NetBeans occasionally),
and the /Library/Java/Home/bin part of your PATH variable. I would expect them to be set in your .profile file in your home directory.


You'll probably need to log out and back in for the changes to take effect at the GUI level.


Kind regards,

Maarten


On 28 Sep 2008, at 21:04, Gary Nunes wrote:

Maarten Hazewinkel wrote (9/28/08 6:07 AM):

Hi Gary,

I'm getting into this a little bit late, so forgive me if I missed
something that's already been looked at.


I appreciate your interest. I'm happy to see as many people looking at this
as problem as desire to.




It sounds like somehow Java 1.6 is taking precedence in a number of
situations, including the javac
command from IDEA and at the end of the multi-layered startup scripts
in NetBeans.

If 1.6 is taken, no options like -d32 or -client will take effect, it
will always run in 64bit server mode.

I can think of a few ways in which that might happen. To verify I'd
like to try a few terminal commands.

If you can run these, and mail me the output, perhaps that can help:

Happy to do so. Some I've done before but more knowledgeable eyes may see
better.





java -version (very basic, see which java gets picked up by default)


java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode)





set
(list all environment variables in effect)


ANT_HOME=/Users/gnunes/Documents/Development/Java/classes-libraries- tools/ap
ache-ant-1.6.5
Apple_PubSub_Socket_Render=/tmp/launch-K0YLTn/Render
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="2" [2]="17" [3]="1" [4]="release"
[5]="i386-apple-darwin9.0")
BASH_VERSION='3.2.17(1)-release'
CATALINA_HOME=/Library/Tomcat
CLASSPATH=:bsh-2.0b4.jar
COLUMNS=120
COMMAND_MODE=unix2003
DIRSTACK=()
DISPLAY=/tmp/launch-2MvYZu/:0
EUID=501
GROOVY_HOME='/Downloads/++Java-XML-XSL Related/groovy-1.0-RC-02'
GROUPS=()
HISTFILE=/Users/gnunes/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/Users/gnunes
HOSTNAME=FlyingMonkeys.home
HOSTTYPE=i386
IFS=$' \t\n'
JAVA_HOME=/Library/Java/Home
LANG=en_US.UTF-8
LINES=50
LOGNAME=gnunes
MACHTYPE=i386-apple-darwin9.0
MAILCHECK=60
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man
OPTERR=1
OPTIND=1
OSTYPE=darwin9.0
PATH='/Library/Frameworks/Python.framework/Versions/Current/bin:/ Library/Jav
a/Home/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/ bin:/Librar
y/Tcl/bin:.:/Downloads/++Java-XML-XSL Related/groovy-1.0-RC-02/bin'
PIPESTATUS=([0]="0")
PPID=6090
PS1='[\h:\W] \u\$ '
PS2='> '
PS4='+ '
PWD=/Users/gnunes
SECURITYSESSIONID=a23e10
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive- comments:
monitor
SHLVL=1
SSH_AUTH_SOCK=/tmp/launch-dawgld/Listeners
TERM=xterm-color
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=240
TMPDIR=/var/folders/DG/DG+8O7Vq2RW2jk+1Yqgnp++++TI/-Tmp-/
UID=501
USER=gnunes
_=-version
__CF_USER_TEXT_ENCODING=0x1F5:0:0




which java
(see which java executable is used. Should be /usr/bin/java)


/Library/Java/Home/bin/java

NOTE: Some time in distant memory I read (in some Apple document) that
JAVA_HOME should be set to "/Library/Java/Home" rather then to something
more explicit. This may explain the result of the "which java" command (as
opposed to your expected result).




cat ~/.MacOSX/environment.plist
(A file that can set environment variables for all Mac OS X
applications, not just shell-invoked ones).



cat: /Users/gnunes/.MacOSX/environment.plist: No such file or directory


NOTE: there's no .MacOSX directory



Kind regards,

Maarten




Thanks for the help,
   gary


P.S. Since you indicated you only recently looked at this. Here's a summary (ignore if it looks like stuff you already know):

- The problems described below are rare but not unique to by system.
- NetBeans crashes on Finder launch (icon double click) but not on Terminal
launch (open "/Applications/NetBeans/NetBeans 6.1.app").
- The Finder launch crash log indicates a crash in 64-bit mode.
- Terminal launched NetBeans runs in 32-bit mode.
- Some people with the problem can't run from the Terminal without using a
sudo command (there may be others who can't run under any circumstances ...
not sure about that though).
- Nothing on my system is explicitly set to use 64-bit mode or Java 1.6 (as
far as I know).
- Debugging statements added to the shell script that NetBeans ultimately
uses to launch itself (nbexec in the NetBeans.app package) seem to indicate
that the command lines generated for Finder and Terminal launch are
equivalent.
- Another IDE, IntelliJ IDEA launches successfully (as far as I can tell)
but, when commanded (from its menu commands) to compile/rebuild/make a
project, the compile/etc. fails with a crash log that is very similar to the
NetBeans crash log.
- If I use IDEA to generate an Ant script to do the project rebuild/ make,
and then run the Ant script, the rebuild/make works.




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