tags:

views:

472

answers:

6

I know when Leopard came out everybody (well, everybody that was a Java developer and cared enough to do development on a Mac) was pissed that there was no Java 6 SDK support. I know somebody provided some kind of hack way a few months after Leopard was released, but I could have sworn that I read sometime later that Apple and/or Sun finally put out an official version of the Java 6 SDK.

So now a year and a half later I am finally interested in doing some Java dev on the Mac (thank Google App Kit for that). But when I go to Apple's Java site... all I see is stuff about Java 5.

So, can I do Java 6 on a Mac?

See also: Installing Java 6 on Mac OS

A: 

http://developer.apple.com/java/

Looks like you can.

Stefan Kendall
But is that the dev kit or just the JRE?
bpapa
It's the JDK. You should have the JDK as long as your 10.5 box is fully updated. At least my Mac does, and I never manually downloaded anything since I already had Soylatte... Try typing javac -version in a terminal to find out.
Joshua McKinnon
+2  A: 

Yes, JDK6 is available.

However, some versions of Eclipse do not support it. There is a new one (based on Cocoa) that should but it is not officially available.

Uri
Sounds like too much of a pain in the nuts. Might stick with Java 5. Thanks.
bpapa
It used to be horrible pain, it is much better now. Give it a shot. I still compile for Java 5 but I'm planning to make the move.
Uri
Besides, it'll be 10 years till we get Java 7 :) I wish Sun would wrestle away Java support on Mac from apple. At EclipseCon half the people had Macs. It's about time we started getting real support.
Uri
You can still use Eclipse to develop for Java6, just Eclipse itself needs to run on Java5 (The project JVM can be different).
Thilo
@Thilo: that's a good point. I'm usually afraid of classpath hell situations, and either way, most of my code is Eclipse plug-ins, so I'm stuck with whatever Eclipse supports.
Uri
Eclipse apparently explicitly asks to be invoked with Java 5 for OS X. Java 6 is 64-bit only but "feels" the same as version 5. It is trivial to change to Java 6 inside Eclipse for your own work.
Thorbjørn Ravn Andersen
@Thor: Which version of Eclipse?
Uri
+6  A: 

Yes, JDK6 is available, and it is quite nice, for example it supports DTrace, which otherwise you only get on Solaris.

The main drawback is that Apple is very aggressive in deprecating older hardware (and OS versions). Java6 will never be released for Mac versions before 10.5, and only works on 64bit Intel. That also kills native 32 bit libraries, such as SWT/Carbon, which is what Eclipse uses (they need to move to Cocoa now).

Update: Snow Leopard apparently has Java6 for 32bit Intel, too (in addition to 64bit).

Thilo
+2  A: 

You can but you have to be very wary of Apple on this one. Sun released JDK 6 in December 2006. Apple released Java 6 for MacOS X a year later.

Why the delay? It seems that integrating the new Look and Feel was the answer but we don't have an official reason.

Now if Java 6 was important to you at the time this would've been (and was) a big deal.

As other answers mention, support for certain hardware and libraries can also be problematic.

windows and Linux are (imho) still the preferred Java development platforms. If it ever becomes critical you can always do Java development on a Mac in a VM however.

cletus
I have understood it was to be a OS X 10.5 thing (which is clearly marketing). The latest Java 5 + 6 is quite nice and Java 6 u 13 based.
Thorbjørn Ravn Andersen
+3  A: 

http://developer.apple.com/java/ (which is only for 64-bit Macs)

http://landonf.bikemonkey.org/static/soylatte/ (SoyLatte, a separate Java 6 port).

Don Werve
SoyLatte even has an early OpenJDK 7 port available
Joshua McKinnon
SoyLatte uses X11 graphics. If you need Aqua graphics, you must use the Apple JVM.
Thorbjørn Ravn Andersen
+2  A: 

Partly. Apple released its version of Java SDK 6 a few months back. But there are still some functions which are not available on Apple's SDK 6 which exist in Sun's Java SDK 6. I don't know why this is so.

For e.g., after Unisys's patent on GIF format expired, Java included the capability to write image files in GIF format in SDK6. Yet, you still can't write GIF files on Apple's SDK.

euphoria83