Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sms

macrumors newbie
Original poster
May 8, 2005
7
0
I just updated to 5.0 and changed the java version from the java preferences as instructed in the installation instructions. However, from the terminal if I type java -version it shows that the 1.4 is still the default. Can someone tell me how to set 5.0 as the default from the terminal.
 

DXoverDY

macrumors 6502a
Apr 19, 2005
810
0
sms said:
I just updated to 5.0 and changed the java version from the java preferences as instructed in the installation instructions. However, from the terminal if I type java -version it shows that the 1.4 is still the default. Can someone tell me how to set 5.0 as the default from the terminal.

You will also have to restart terminal.app i believe to make the changes effective for that shell.. double check your directions and try it again, you probably just misread and didn't do something right.

as a side note, anyone who is updating may want to be warned that it does break some applications that ran fine with 1.4... so be careful and if you find an app doesn't work anymore, that would be why.
 

sms

macrumors newbie
Original poster
May 8, 2005
7
0
DXoverDY said:
You will also have to restart terminal.app i believe to make the changes effective for that shell.. double check your directions and try it again, you probably just misread and didn't do something right.

as a side note, anyone who is updating may want to be warned that it does break some applications that ran fine with 1.4... so be careful and if you find an app doesn't work anymore, that would be why.

I restarted terminal.app, restarted the machine, kicked it a couple times and still no go. Any idea what the command is to change the java version from the command line, been looking everywhere and I can't seem to find it.
 

Pronil

macrumors newbie
Nov 16, 2005
2
0
Changing Java Version in MAC

Hi Mate,

I have done it very manually. Actually, as you install higher version of java, the current jdk directory points to it. At the same time the older versions are not deleted and an archive are maintained. In case of JDK 1.5 this does not happen. The information about the java is stored in Infor.plist under the resource directory.
In order to change java to any new or restore to previous version this following step works
Go to : /System/Library/Frameworks/JavaVM.framework/Versions
Copy all the files and directories from the particular version directory which you want to change to and paste them to the folder CurrentJDK.
e.g. to change to 1.5 I will copy all the folders from /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/ to /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/

To perform any action on system folders you need to have system root login.
Please be careful in changing any system files with this login as the login has full right to curropt the OS too.
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,976
4,543
New Zealand
Just use the Java Preferences app. It's a bit tricky to find, so the easiest way is to use Spotlight.

If you want to open it manually, it's in /Applications/Utilities/Java/J2SE 5.0/Java Preferences.

Edit: It seems that this doesn't change everything, as "java -version" is still reporting 1.4.2 for me.
 

Pronil

macrumors newbie
Nov 16, 2005
2
0
Creating symlink or alias did not helped, only copying did. CurrentJDK direcotry is actually an alias of 1.4.2 directory. Now, where this information is stored, I was unable to find out, so the only thing for time being we can do is use 1.4.2 or CureentJDK directory act as 1.5 that can only be done by copying all the installed file of 1.5 to the CurrentJDK folder or virtually in 1.4.2 folder. Thus, prior to this preserve the content of 1.4.2 in some other folder, this will help u to revert to 1.4.2(or previous version) any time.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.