|
|
Do not do this!
To repeat my comment from the last time a "hint" appeared suggesting a script for changing the Java version by modifying the symbolic links:
Arrgh! Changing the symbolic links (as is done by this script) is the wrong way to do this. This has been strongly recommended against by Apple. The right way to switch between Java versions is to use the facilities provided in the "Java Preferences" utility (provided with the Java 5 release in a recent software update) for GUI apps, and to change the execution PATH for command-line Java apps. This was all explained in my macosxhints forums writeup and in this recent hint.
Changing the symbolic links is definitely the wrong way to go. Note that the forums writeup referred to above supplies Bash functions for changing the Java version the correct way - by changing the PATH and JAVA_HOME environment variables. I also note that Apple is on the verge of releasing a new Java update that will make Java 1.5 (aka Java 5) the default Java version.
Do not do this!
Arrgh! Changing the symbolic links (as is done by this script) is the wrong way to do this. Why? Have you actually tried it? I've been using the symbolic link approach since the 1.5 release was first available, and I've never had any problems. If there ever are problems, though, I can always switch the symbolic link back. It's really not a big deal. This has been strongly recommended against by Apple. Link please?
a better way
I've been using the symbolic link approach since the 1.5 release was first available, and I've never had any problems. If there ever are problems, though, I can always switch the symbolic link back. It's really not a big dealI'm not claiming that changing the symlinks doesn't work. Of course it works. I'm just saying that you shouldn't do it because there is a better way. The better way is to change the PATH and JAVA_HOME variables to point to the version you want. This is better because it is far less intrusive and more flexible. And it doesn't mess with something that is going to get overwritten with the next update from Apple. It's the right thing to do. Link please?Apple's release notes say that you should use the full path to the Java executables to specify which version you want. And here's a Java-Dev mailing list post from an Apple employee that spells out "the reasons that we recommend developers NOT modify this symlink".
There *are* reasons to do this
Changing the symlink is not the best way to address this problem, but sometimes it is the most expedient from a risk/reward ratio perspective. I'll give you an example...
exceptional cases
Zimbra wouldn't look at anything other than the 1.4.2 JDK. A quick symlink change later, and voila -- everything works like a charm. Should Zimbra fix the distribution so we don't have to change the symlink? Absolutely. Is there anything wrong with me wanting to get the damn thing up and running without wasting any more time?You didn't make it clear what you were trying to do, or what the real problem was. You said that Zimbra "wouldn't look at anything other than the 1.4.2 JDK". But that is (currently) the default JDK, so I don't understand the problem. But in any case, there is obviously nothing wrong with changing the symlink as a hack to work around some broken software that you need to work now as long as you realize that it is a hack and that you are doing it in desperation. It is quite different to recommend (like the article) changing the symlink as the general way to do things when a much better way exists.
Of course it's exceptional
You didn't make it clear what you were trying to do, or what the real problem was.Actually, I did make it clear. You just didn't get it. Zimbra will not work with a JDK less than 1.5. You said that Zimbra "wouldn't look at anything other than the 1.4.2 JDK". But that is (currently) the default JDK, so I don't understand the problem.When using the "much better way" you recommend to specify 1.5 as the default JDK, Zimbra still looks at the 1.4.2 JDK and refuses to run. That is the problem. The rest of your comment is redundant. Nobody is arguing that changing the symlink is the best way to do things, but rather that it is sometimes a necessary evil.
Zimbra NEEDS JAVA 1.5
Zimbra needs JAVA 1.5 |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.10 seconds |
|