Authored by: hayne on Fri, Jan 27 '06 at 07:35AM |
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 ]
|
|
Authored by: wilton on Fri, Jan 27 '06 at 07:42AM |
Agreed, this method can lead to problems...
Cyberduck broke doing this, and the author seems to have had many users complaining of the same thing.
Will
[ Reply to This ]
|
|
Authored by: yanokwa on Fri, Jan 27 '06 at 09:13AM |
If it's just a command line problem, why don't you make an alias?
For example in zsh
alias javac15='/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Command$
alias java15='/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands$
[ Reply to This ]
|
|
Authored by: raider on Fri, Jan 27 '06 at 09:38AM |
I just wish this thing would die.
Hayne seems to think that his word gospel and that we should all believe him because he wrote a forum post.
The WHOLE REASON THAT THEY ARE SYMBOLIC LINKS is so that you can change
them. That is the purpose for using symbolic links... AND - you can
ALWAYS change them BACK!
I am a Java developer. I have been using Java 1.5.x with OSX since the
first day it was released in beta. I have been using it with modified
symlinks since day one.
I use Eclipse, XCode, and several other database and development tools.
In addition, I have several Java applications not related to
development. Even the most important Java application on my system,
Puzzle Pirates. :)
They all work just fine. My system has even been through at least one
automated Java update since the beta - which worked just fine and had
no problems with the symlinks.
There is no reason to panic and if you would like to try it, changing
you symlinks is just fine. If you find it causes a problem for
something you use - then change it back. It is that simple.
And would the naysayers please just stop reading the hints regarding
changing your Java symlinks - because obviously some people WANT it
regardless of what you say. Be happy that you authored a forum post,
and that you have warned appropriately and let the rest of us get on
with our hints and tips.
As with any of the MacOSXHints - they are *always* "use at your own risk"
[ Reply to This ]
|
|
Authored by: stewarsh on Fri, Jan 27 '06 at 11:04AM |
I'd like to
point out that Sun (who invented Java) does precisely the same thing in
Solaris to allow the sysadmin to change which java the user gets by
default. Which is why /usr/bin/java is a link and not a real binary.
UNIX systems often use links to allow multiple version support, and OS X is no different.
[ Reply to This ]
|
|
Authored by: aamann on Sat, Jan 28 '06 at 11:57AM |
Easily? - I guess using the Java Preferences Utility (which is also the official method recommended by Apple) is much easier... [ Reply to This ]
|
|