Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java 1.5 on mac

 
Cathy Song
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Could someone please point out how to install Java 1.5 (or 5.0)
on a Mac machine?

Thanks,
Cathy.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Mac OS forum...
 
Warren Dew
blacksmith
Ranch Hand
Posts: 1332
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is Java 1.5/5 even final yet?

I'm just planning to wait until it shows up on Software Update.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most recent version of Java for Mac OS X is 1.4.2. I am not aware of a firm date for the availability of 1.5.

Java for OS X
[ August 23, 2004: Message edited by: Bear Bibeault ]
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm fairly sure that JDK 1.5/5.0 will be out when OS X 10.4 goes final. Tiger on Tiger you could say.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How poetically appropriate.
 
Gaurav Mac Mathur
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think there is any Official decleration of Java 1.5 coming with Tiger though.
Latest what u can get NOW is
Java 1.4.2_05
Cheers
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you get the beta version of Mac OSX Tiger, it currently does come with Java 1.5 (Java 5), and people I know are using it. I'm getting ready to join the Apple Developer Network so that I can get the Mac Tiger beta, to start playing with it. The rumor is that both the OS Tiger and Java Tiger on the Mac are quite stable. One of our co-authors has permanently switched his Mac to the Tiger beta, and says it's been better for him than previous final releases of Jaguar, for example. Java 1.5 is DEFINITELY a part of the Max OSX Tiger, but I don't think Apple is planning to release Java 1.5 *before* they release the Tiger OS. So, far as I know, the only way to get 1.5 on the Mac is to get the beta of the OS.

cheers,
Kathy
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any word on whether OS X Tiger will be necessary to use Java 1.5, or will it become available for Panther as well?
 
Warren Dew
blacksmith
Ranch Hand
Posts: 1332
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No official word that I know of, but Java 1.4 was released on OS 10.2 after 10.3 was current. My guess is that Java 1.5 will be available on older machines.
 
Stephen Bloch
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so I have to wait for 10.4 before getting Java 1.5 on my Mac. What does the rumor mill say about when 10.4 will be out?
 
Philip Herzer
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephen, what I've heard is that it will be released first quarter of 2005, around March.
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, it *is* possible now to run Java 1.5 on Panther...

A little bird told me that if you simply copy the Java binaries from a 10.4 (Tiger) machine directly onto your 10.3 (Panther) machine, it'll work. So that means one would have to be able to access a machine with 10.4, in order to get the actual JDK files (the stuff that goes in /System/Library/Frameworks/JavaVM.Framework/Versions (I think that's the path...)

And let's just say that I have seen it work with my own two eyes

Yes, you can be happily compiling and running the Apple beta of Java 1.5/5.0 on Panther. [I'm pretty sure it doesn't have any graphics support at this point, but who cares... you're probably only interested in trying out the new language features.]

Of course this is extremely unofficial, and it's not like *I* would actually do anything like this.

But I did happen to *see* someone do this and it indeed worked

It is possible (although currently still unlikley) that Apple will make it available as an unofficial, unsupported download for Panther. People are talking about it, but I would not hold my breath on that.

Anyway, that's the latest...
 
eric mac
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey all. when attempting to implement the solution provided by kathy (big thanks for that=) a friend suggested this alternate. (you don't need access to tiger)


go here and get 'pacifist' it's a 'can opener' app that lets you extract individual files from .pkg installers.

http://www.charlessoft.com/Pacifist.dmg

then go here and get the java 2SE50 release for tiger... extract the versions folder and you're in business.=)

http://www.apple.com/support/downloads/java2se50release1.html
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Eric"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark
 
Gabe Herbert
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once the process had been completed, how would one enable the newer version?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added the following to my .bash_profile:

 
John Davis
Ranch Hand
Posts: 73
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, but im learning java. What's the .bash_profile?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.bash_profile is a shell script that is executed when a bash shell logs in (which happens every time you open a Terminal window). You can use it to set up aliases, environment varaibles, and other useful things.

It "lives" in your home folder.

Be aware that (by default) files beginning with a dot are considered hidden and will not show up in Finder.
 
John Davis
Ranch Hand
Posts: 73
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do I change it?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you open Terminal, its working folder should be your home folder, which is where your .bash_profile should be. But if you haven't already created a .bash_profile, then you might not have one. So first, to ensure the file exists, enter the following in Terminal...

This will create the file if it doesn't already exist. (If it does exist, this will just update the time-stamp.) Next, use the following command to open the file in TextEdit...

After you've modified and saved the file in TextEdit, then make sure the file has the proper permissions by entering the following in Terminal...

(See Wikipedia - touch and chmod.)
[ August 21, 2006: Message edited by: marc weber ]
 
John Davis
Ranch Hand
Posts: 73
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use netbeans and scanner wont work so what's wrong?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember, Java is case sensitive. So your import statement needs an uppercase 'S' in "Scanner."

If it still doesn't work after fixing this, then we should verify that you are actually compiling with Java 1.5. At the prompt in Terminal, type "javac -version" (without the quotes). You will get a long error message because you didn't specify a file to compile, but it should start by telling you the version...

...javac -version
javac 1.5.0_06
javac: no source files...
[ August 21, 2006: Message edited by: marc weber ]
 
John Davis
Ranch Hand
Posts: 73
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't get your terminal command to work, but in Netbeans preference window it says I still have 1.4.2_9. I did everything above though?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you running Java 1.5 on OS X 10.3.9 (per your previous post)? If so, I think you should first confirm that Java 1.5 is working under that OS before getting into any IDE configuration.

Have you modified your .bash_profile as indicated above?

What exactly do you get in Terminal when you type the following?
 
John Davis
Ranch Hand
Posts: 73
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got this

And yes im running 10.3.9 and tring to run Java 1.5
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the -version flag for javac is new with 1.5.

I'm at work on a Windows machine now. To go any further troubleshooting this, I need to be in front of a Mac. I'll post back tonight (unless it's resolved before then).
 
John Davis
Ranch Hand
Posts: 73
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I put the versions folder in this path

/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home

was there any thing else I need to have?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you update your .bash_profile as indicated above?

I'm not familiar with OS 10.3, so maybe you should wait for someone more Mac-savvy to confirm this. (Bear?) But if your Java Frameworks are set up like they are in 10.4, then there is a "CurrentJDK" alias under /System/Library/Frameworks/JavaVM.framework/Versions. This alias points to the folder of the "current" Java version. If have have this alias, then you should probably update it to point to the 1.5 folder as follows:
  • Open Terminal.
  • Identify yourself as the administrator by typing: sudo su root
  • Terminal will prompt for the admin password. Enter this.
  • Change the current directory by typing: cd /System/Library/Frameworks/JavaVM.framework/Versions
  • Within this directory, there is an alias called CurrentJDK pointing to the "current" version of Java. You need to remove this alias by typing: rm CurrentJDK
  • Now you need to replace it with a new alias pointing to the 1.5.0 directory instead. Do this by typing: ln �s 1.5.0 CurrentJDK
  • Finally, log out of the session as administrator by typing: exit

  • [ August 22, 2006: Message edited by: marc weber ]
     
    John Davis
    Ranch Hand
    Posts: 73
    Mac
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    In Terminal can I compile java?
     
    marc weber
    Sheriff
    Posts: 11343
    Java Mac Safari
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by John Davis:
    In Terminal can I compile java?

    Absolutely! That's what the javac (java compiler) command is for. Use the cd command to change directories to the folder that contains your .java file, then compile with javac, and run with java (java runtime). Note that to compile a java file with the javac command, you include the ".java" extension -- but to run a class file with the java command, you do not include the ".class" extension. For example, if MyFile.java was under java/tests, then the Terminal commands would be...
     
    John Davis
    Ranch Hand
    Posts: 73
    Mac
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    wow thats really good to know

    so should I be able to use 1.5.0 in the terminal now?

    and I cant use the IDE because I need to set them up to load 1.5.0?
     
    marc weber
    Sheriff
    Posts: 11343
    Java Mac Safari
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    If you followed the instructions for changing the CurrentJDK alias to point to the 1.5.0 folder, then you should be set for compiling and running in 1.5 via Terminal. Repeat the "javac -version" test above and see what you get now.

    NetBeans will probably still need some additional configuration to use 1.5. For that, you might have better luck in the IDE forum. However, because you're trying to run Java 1.5 on Mac OS X 10.3 (which reportedly works, but isn't "official"), I think you should make sure Java 1.5 is working okay through Terminal before trying to get an IDE to work with it.
     
    John Davis
    Ranch Hand
    Posts: 73
    Mac
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    oopps I did all the above code and it didn't work, later I realized that the CurrentJDK alias was on my desktop (typo maybe?) anyway I used this code in terminal


    mv(move)<current location>(space)<new location>

    (nifty tip) in terminal you can drag files from the finder to the terminal window and the file path will appeare with a space after the path

    Thanks everyone who helped make Java 1.5.0_02 work on my 10.3.9 system
     
    John Davis
    Ranch Hand
    Posts: 73
    Mac
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ooops

    I mean

    then type your password in
     
    marc weber
    Sheriff
    Posts: 11343
    Java Mac Safari
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by John Davis:
    ...(nifty tip) in terminal you can drag files from the finder to the terminal window and the file path will appeare with a space after the path

    Thanks everyone who helped make Java 1.5.0_02 work on my 10.3.9 system

    That's a cool Terminal tip -- I wouldn't have suspected that would work.

    Congratulations on getting 1.5 working!
     
    John Davis
    Ranch Hand
    Posts: 73
    Mac
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    where does the .bash_profile go, because nothing java works now
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Pie
    Posts: 64827
    86
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Your home folder. That'd be /Users/whatever, where whatever is your login name, in the Finder. Or ~ (yes, tilde) in a Terminal window -- that's where your current directory will be set upon opening a Terminal instance.

    Be aware that hidden files that begin with . are not visible in the Finder.
     
    John Davis
    Ranch Hand
    Posts: 73
    Mac
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    hmmmmm... I've tried every thing and still nothing works
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic