Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Do not do this!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Do not do this!
Authored by: hayne on Jan 27, '06 07:35:32AM
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.

[ Reply to This | # ]

Do not do this!
Authored by: vocaro on Jan 27, '06 10:12:25AM

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?



[ Reply to This | # ]
a better way
Authored by: hayne on Jan 27, '06 12:27:26PM
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
I'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".

[ Reply to This | # ]

There *are* reasons to do this
Authored by: SnowLprd on Jan 27, '06 04:51:57PM

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

When using the Mac OS X distribution of the Zimbra collaboration suite, the JAVA_HOME environment variable is supposed to be set correctly. The only small problem is that it's not. I wasted *hours* trying to figure out why Zimbra wouldn't work, only to realize that it was the fact that 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? Absolutely not. If you need to change the symlink in order to make your life easier, but all means -- do it. As others have pointed out ad nauseum, you can always change it back.



[ Reply to This | # ]
exceptional cases
Authored by: hayne on Jan 28, '06 07:41:59AM
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.

[ Reply to This | # ]

Of course it's exceptional
Authored by: SnowLprd on Feb 18, '06 10:17:41AM
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.

[ Reply to This | # ]
Zimbra NEEDS JAVA 1.5
Authored by: oem on Jan 30, '06 06:21:11AM

Zimbra needs JAVA 1.5
it won't work with JAVA 1.4.x (at least on OsX).

I do use the symlink 'trick' to point current JDK to the 1.5;
It works like a charm.
It may be not the BEST WAY (it's the ugly way as I call it) but it works, and it's the ONLY WAY to get zimbra works.
Well it's the only way to get the Zimbra server to work.
The client don't need to change anything. just need to use Firefox as safari dosen't work at all with zimbra.

I've tried many tricks like editing the .profile or .bashprofile etc…
the only way to get things working is to change the symlink to point to 1.5.




---
I luv mac, Vindoze Sucks



[ Reply to This | # ]