i know i've posting a lot about mac开发者_StackOverflow社区 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
Did you take a look at Applications/Utilities/Java? You can switch between different versions of Java there, permanently.
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
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"
精彩评论