views:

11203

answers:

7

Hi everyone,

I want to install a specific jdk (the latest for example). For this, i went to jdk download homepage: http://java.sun.com/javase/downloads/index.jsp I look for a mac version but i'm a bit surprise to have only downloadable version for linux, window and solaris..

Here the message for Mac: "Apple Computer supplies their own version of Java. Use the Software Update feature (available on the Apple menu) to check that you have the most up-to-date version of Java for your Mac."

OK BUT... when I update java with mac I have a jre and not a jdk ...

I don't understand why it doesn't exist a jdk version easy downloadable/installable (like a jar to unzip?) for Mac ....

Thanks

ps: I'm newbee on mac :)

+5  A: 

Which version of the Mac OS do you have?

Apple ships a full JDK, this is what I get on a default install of Snow Leopard:

$ javac -version
javac 1.6.0_15
$ which javac
/usr/bin/javac

$ ls -la /System/Library/Frameworks/JavaVM.framework/Versions/
lrwxr-xr-x   1 root  wheel    5 Sep 24 20:12 1.3 -> 1.3.1
drwxr-xr-x   3 root  wheel  102 Jul 21 07:35 1.3.1
lrwxr-xr-x   1 root  wheel   10 Sep 24 20:12 1.5 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Sep 24 20:12 1.5.0 -> CurrentJDK
lrwxr-xr-x   1 root  wheel    5 Sep 24 20:12 1.6 -> 1.6.0
drwxr-xr-x   7 root  wheel  238 Sep 24 20:12 1.6.0
drwxr-xr-x   8 root  wheel  272 Sep 24 20:12 A
lrwxr-xr-x   1 root  wheel    1 Sep 24 20:12 Current -> A
lrwxr-xr-x   1 root  wheel    3 Sep 24 20:12 CurrentJDK -> 1.6

You may get other versions from the Developer Tools, but basically the default install will give you a working JDK. You do not even have to set any paths or stuff like that.

Thilo
+2  A: 

As the message says, you have to go to Apple, not Sun, for Java on the Mac. As far as I know, Apple JDK 6 is installed by default on Mac OS X 10.6 (Snow Leopard). Maybe you need to install the developer tools from your Mac OS X installation DVD (the dev tools are an optional install from the OS DVD).

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

Jesper
+1  A: 

Mac comes with the JDK, for more information check:

http://developer.apple.com/mac/library/documentation/Java/Conceptual/Java14Development/02-JavaDevTools/JavaDevTools.html

pedromarce
A: 

As a rule you cannot install other versions of Java on a Mac than those provided by Apple through Software Update. If you need Java 6 you must have a 64-bit Intel computer. You should always have Java 5 and 1.4 and perhaps 1.3 installed if you have at least OS X 10.4.

If you have VERY much elbow grease and is willing to work with beta software you can install the OpenJDK under OS X, but I don't think you want to go there.

Thorbjørn Ravn Andersen
+1  A: 

Thanks everyone for your responses.

The explaination is that jdk is a bit specific and does not contains the lib tools.jar. For my development i need this lib and mac's jdk doesn't provide it:

(cf. http://developer.apple.com/mac/library/documentation/Java/Conceptual/Java14Development/02-JavaDevTools/JavaDevTools.html)

"tools.jar does not exist. Classes usually located here are instead included in classes.jar. Scripts that rely on the existence of tools.jar need to be rewritten accordingly."

sucks !

Thanks for all your responses !

ajeanson
Ahhhhhhh!!! As you discovered, `tools.jar` is already included in the runtime for Mac OS X. So looking for `tools.jar` isn't the right approach on Mac to know if it's a JDK or JRE :)
Pascal Thivent
Thanks for your response, you are right. My need was to get the tools.jar lib for a specific project and for me it was an approach to recognize a jdk ;)
ajeanson
+1  A: 

As of Snow Leopard, you can run Java 6 in 32-bit mode on either 32-bit or 64-bit intel processor equipped Macs.

If you cannot upgrade to Snow Leopard, Soy Latte is a pre-compiled version of Java 6 for Intel 32-bit.

Brian M. Carr
A: 

I have searched the web high and low attempting to find a way of installing an older version of a JDK on snow leopard. So far I seem to be out of luck. I recently switched to OS X for reliability reasons and now I can't compile my java apps that are targeting an old 1.3.1 platform. It is very frustrating to use a Windows VM just to use Netbeans to compile for 1.3.1.

Any instructions, hand holding, repository pointing, or insightful help would be greatly appreciated.