Several months ago I downloaded NetBeans 7.0 with All Supported technologies from this page.
I find myself on TextMate more often instead of NB when experimenting Java codes, I open NB maybe once in every 2 weeks or a month, but I open TextMate everyday, anyway. One feature that I love from TextMate is command r
to compile and run.
But the thing is it's using java version "1.5.0_28". Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_28-b04-382-9M3326). Java HotSpot(TM) Client VM (build 1.5.0_28-157, mixed mode, sharing)
from my Mac OS X 10.5.8
How can I make TextMate running Java from NB 7.0 instead?
I asked a question on Unix SE regarding the complete NB's Java path but I still don't get the executable Java I'm looking for. Does anyone familiar with Java and NetBeans have any ideas?
Update 2: Thanks for the awesome comments, guys!
For @romainl, now how can I add this Java SE 6
to my path $JAVA_HOME
at my .profile
when I don't know where its path is being located? My Java Preferences is this
For @slhck, now how can I know Java SE 6
path from my Activity Monitor? hmm this app is like UNIX top
, eh?
/Applications/Utilities/Java Preferences.app
? It will show what versions of Java are available and active. NB 7.0 doesn't work with Java SE 5, it needs 6 so if it is running fine you'll probably have both in the list. If yes you may uncheck 5 and see what happens. Depending how the Java runtime is called from TextMate's Java bundle you will probably need to add/edit the$JAVA_HOME
environment variable in your~/.bashrc
or~/.profile
. It's possible that the runtime's path is hardcoded in the bundle (a few bundles do that), did you take a look?SE 5
. After it's done,java -version
in a new terminal window should show that you run Java SE 6. After relaunching TextMate, doCmd-r
. Did it work? If not, the problem may come from the Java bundle and you'll have to search for some hardlinked or hardcoded reference to the old Java SE./usr/bin/java
returned bywhich java
is an alias to/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java
. Look around for the correct path to Java SE 6, but I suspect you won't need it.