Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 8, 2005, 05:29 PM   #1
sms
macrumors newbie
 
Join Date: May 2005
changing java version

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.
sms is offline   0 Reply With Quote
Old May 8, 2005, 06:25 PM   #2
DXoverDY
macrumors 6502a
 
Join Date: Apr 2005
Quote:
Originally Posted by sms
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.
DXoverDY is offline   0 Reply With Quote
Old May 8, 2005, 06:33 PM   #3
sms
Thread Starter
macrumors newbie
 
Join Date: May 2005
Quote:
Originally Posted by DXoverDY
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.
sms is offline   0 Reply With Quote
Old Nov 16, 2005, 04:38 AM   #4
Pronil
macrumors newbie
 
Join Date: Nov 2005
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.
Pronil is offline   0 Reply With Quote
Old Nov 16, 2005, 05:25 AM   #5
caveman_uk
Guest
 
caveman_uk's Avatar
 
Join Date: Feb 2003
Location: Hitchin, Herts, UK
Can't you just symlink them rather than copying?
caveman_uk is offline   0 Reply With Quote
Old Nov 16, 2005, 05:30 AM   #6
Nermal
Moderator
 
Nermal's Avatar
 
Join Date: Dec 2002
Location: Whakatane, 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.
Nermal is offline   0 Reply With Quote
Old Nov 16, 2005, 09:53 AM   #7
devman
macrumors 65816
 
devman's Avatar
 
Join Date: Apr 2004
Location: AU
http://developer.apple.com/releaseno...3RN/index.html

The Using J2SE section and Outstanding Issues section.
devman is offline   0 Reply With Quote
Old Nov 22, 2005, 05:27 AM   #8
Pronil
macrumors newbie
 
Join Date: Nov 2005
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.
Pronil is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
java 7 version 51 safe to use? jetlagged Mac Basics and Help 2 Mar 21, 2014 12:49 PM
What Java version do I need? MacMan988 OS X Mavericks (10.9) 1 Nov 23, 2013 11:13 AM
Java version confusion inscrewtable Mac Basics and Help 2 Oct 2, 2013 12:29 PM
How to add new Java version to Java Preferences? neuropulse OS X 0 Jul 15, 2013 01:00 PM
uninstall apple's java version? MacMan988 OS X 10.8 Mountain Lion 38 Feb 1, 2013 09:03 AM

Forum Jump

All times are GMT -5. The time now is 04:43 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC