views:

258

answers:

4

Hello guys i know i've posting a lot about mac lately and setting up my environment to develop on java 1.6. after trying to set my etc/launch.conf like so

setenv JAVA_VERSION 1.6
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/
setenv CATALINA_BASE /Library/apache-tomcat6020
setenv CATALINA_HOME /Library/apache-tomcat6020
setenv CATALINA_TMPDIR /Library/apache-tomcat-6.0.20/temp

and with sodu i can't run my java with 1.6 it was still 1.5 so i found online some workarounds

rm Current*  
ln -s 1.6.0/ Current
ln -s 1.6.0/ CurrentJDK

i works untill i restart the machine and then i cannot run eclipse no netbeans any more.Netbeans start and stop few seconds after and eclipse spit out error code =-1. I just want to come back to 1.5 and see.Java parameter behave the same way as NetBeans. i did the same link stuf for 1.5 by removing the current and create the new link, and updating /etc/launchd.conf to 1.5 no success after restarting the machine. java -version give 1.6.0_15 both on normal user and sudo. What do you think i should do? Thanks for reading

A: 

Did you take a look at Applications/Utilities/Java? You can switch between different versions of Java there, permanently.

wishi
yeah bruv it's simply not starting.i mean it start few seconds and vanish later
black sensei
A: 

Solved part of it by doing

rm ~/Library/Caches/Java/deployment.properties
sudo rm -rf /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0
sudo rm /System/Library/Frameworks/JavaVM.framework/Versions/1.6

Netbeans started working again.But there is one problem though.When i type java i got

-bash: java: command not found

but javac and applerviewer can be run.I guess for that one some one can help me thought it.thanks for reading. Ps: for some in the same situation as me i've read you might have to delete Java SE 6 in /Applications/Utilities/Java if there is one

black sensei
A: 

You should never, ever delete anything in /System (except the contents of /System/Library/Caches if needed for troubleshooting). Reinstall Java 6 (with Apple's latest Java update) before you do anything else, then if you want to change the VM NetBeans uses, either use Java Preferences or add to ~/.netbeans/«version»/etc/netbeans.conf:

netbeans_jdkhome="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home"
Nicholas Riley
thanks for the advice i've come to realise that.So there are things i believe i don't understand. `when you say Reinstall Java 6 (with Apple's latest)` you mean the next time there is an update. i messed up the 1.6.0_15 so you mean when the 1.6.0_17 will be available? i'm asking because the software updater still thinks that i have the 1.6.0_15 and then not showing me the option to Reinstall it.
black sensei
You can download 1.6.0_15 manually to reinstall it. (http://support.apple.com/kb/DL924).
Nicholas Riley
A: 

i installed to snow leopard and solves my issue.thanks to all

black sensei