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 Dec 12, '05 09:11:56AM
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.

[ Reply to This | # ]

Do not do this!
Authored by: vocaro on Dec 12, '05 09:56:58AM

Changing the symbolic links is definitely the wrong way to go.

Explain to me why this is so bad. I've been doing this ever since Java 1.5 was first available, and I haven't had a single problem.



[ Reply to This | # ]
some reasons why not
Authored by: hayne on Dec 12, '05 12:03:01PM

Here's just a few reasons why it is a bad idea to change the symlinks:
1) That involves fiddling in the /System area - it is best to leave this area to Apple on general principles
2) Anything you do under /System is likely to get broken with the next SoftwareUpdate from Apple
3) Changing the symlinks will affect all apps for all users, while some apps might need a different version. I.e. changing the symlinks is a brute force, unsophisticated way of doing things.



[ Reply to This | # ]
Do not do this!
Authored by: gidds on Dec 12, '05 02:13:02PM
Yeah, well, it's all very well telling us to use the Java Preferences app, but what if that doesn't work???

In my case it bounces in the Dock 11 times, then bombs out with a StackOverflowError. What am I supposed to do now?

(Yeah, I did try the symbolic link method, too -- afterwards -- but that didn't give me any joy with other apps either, so I changed it back.)

---
Andy/

[ Reply to This | # ]

Do not do this!
Authored by: baltwo on Dec 12, '05 02:51:48PM
Yeah, well, it's all very well telling us to use the Java Preferences app, but what if that doesn't work??? Then, you have system/user problems that you need to fix. Start with http://docs.info.apple.com/article.html?artnum=106850

[ Reply to This | # ]
Do not do this!
Authored by: jsawers on Dec 13, '05 07:45:46AM

Changing the symbolic link is the *only* way to get command-line executed apps like Tomcat, or something you wrote, to use the proper JVM.

Your warnings are well taken, and people should be aware of the consequences. But Apple gives us no choice. They are being incredibly brain-dead here not letting us set 1.5 as the default JVM if we want it.



[ Reply to This | # ]
Do not do this!
Authored by: CaptDeuce on Dec 13, '05 10:11:40AM
Changing the symbolic link is the *only* way to get command-line executed apps like Tomcat, or something you wrote, to use the proper JVM.

Unable to choose what JVM to use with a command-line app? Highly unlikely. That's almost like complaining that Mac apps make it difficult to use a mouse.

Perhaps you can start here at Tomcat - A Minimalistic User's Guide to determine how to configure Tomcat to use the desired JVM version.

---
--
"Where's my other sock?" - A. Einstein

[ Reply to This | # ]

set PATH for command-line apps
Authored by: hayne on Dec 13, '05 04:18:12PM
Changing the symbolic link is the *only* way to get command-line executed apps like Tomcat, or something you wrote, to use the proper JVM.
You clearly didn't read the article that I linked to - since that explained in detail how to change the PATH variable to get whichever version of Java you want. In fact you didn't even seem to fully read my comment above since I mentioned changing the execution PATH there.

[ Reply to This | # ]
set PATH for command-line apps
Authored by: sjk on Dec 13, '05 08:20:31PM

Any suggestion how to change the JVM version for a Java app launched from a preference pane (EyeHome, to be specific)?



[ Reply to This | # ]
apps launched from Preference panes
Authored by: hayne on Dec 14, '05 09:25:36AM

I have no experience with this, but I would guess that a Java app launched from a preference pane would be supplied in the form of an application bundle and thus should be affected by the settings of the Java Preferences utility. Of course, the developer of that Java app may have specified some Java version (in the Info.plist I think) that results in your settings being ineffective.



[ Reply to This | # ]
apps launched from Preference panes
Authored by: sjk on Dec 16, '05 01:30:44PM
Setting the version in Java Preferences didn't work since it's hardcoded in the Info.plist for the app bundle (thanks for the tip to check that), which was trivial to change:

% pwd
/Library/PreferencePanes/EyeHome.prefPane/Contents/Resources/EyeHome.app/Contents

% diff -C1 'Info copy.plist' Info.plist
*** Info copy.plist     Mon Nov 21 14:12:38 2005
--- Info.plist  Fri Dec 16 11:14:54 2005
***************
*** 33,35 ****
                JVMVersion
!               1.4*
                MainClass
--- 33,35 ----
                JVMVersion
!               1.5*
                MainClass
EyeHome launches okay but I haven't tested it yet.

[ Reply to This | # ]