Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Command-line Java

Command-line Java
Thread Tools
Fresh-Faced Recruit
Join Date: Jul 2006
Status: Offline
Reply With Quote
Aug 2, 2006, 09:05 PM
 
Hi there,
I'm new to macs, so while this is probably a silly question, I haven't been able to figure it out, so help would be appreciated

I'm doing a subject at Uni on Java programming, and am trying to configure my mac so I'm using the correct version of Java (Java 1.5). I know I can use Xcode, and I'm pretty sure that Xcode runs off Java 1.5, but in case I want to use the Terminal to compile and run, I'd like to get this happening too. The faq's at the developer.apple.com site say that any command-line prompts, like java or javac use Java 1.5, but when I type "java -version" into the terminal, it tells me it's using Java 1.4.2. How do I change this?

Thanks in advance for your help!
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Aug 2, 2006, 09:23 PM
 
Check software update?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Junior Member
Join Date: May 2003
Status: Offline
Reply With Quote
Aug 2, 2006, 11:53 PM
 
First, go to /Applications/Utilities/Java. Do you have a folder called J2SE 5.0? If you don't then you need to install java 1.5, it should be in software update. If you have that, then open that folder, and open the Java Preferences app. Use that to tell your computer to use java 1.5 by default. Save and close. Try java -version again, and see if that has fixed it. If that doesn't work, there is some terminal hackery you can do, which I vaguely recall having to do, but I'll need to look it up.
     
Junior Member
Join Date: May 2003
Status: Offline
Reply With Quote
Aug 2, 2006, 11:59 PM
 
Here are some instructions on how to change the default java version to 1.5.
http://blog.innerewut.de/articles/20...mac-os-x-tiger
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Aug 3, 2006, 02:47 AM
 
If you installed the last Java release, your default version should be 1.5.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
BigSim  (op)
Fresh-Faced Recruit
Join Date: Jul 2006
Status: Offline
Reply With Quote
Aug 3, 2006, 04:12 AM
 
Thanks patman, that did the trick

That's what I thought too Chuckit, but for some reason, that wasn't the case
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 02:14 AM.
All contents of these forums © 1995-2015 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2015, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2