Dr. No
Dr. No

Reputation: 1336

How to program with Java 1.6 in a Mac?

I was working in a Java 1.6 project in Windows, and now I have to work from my laptop, that is a Macbook Pro (Intel Core 2 Duo) with a MacOsX Leopard 10.5.8 installed.

In the same laptop I've worked in the past with Java 1.5 with any problems, but now I can't work with 1.6, and I don't know what I'm doing wrong.

When in a terminal I write: java -version I get java version "1.6.0_26"

But when I'm trying to install last version of Netbeans (7.0.1) I get the message:

It's not possibe to install NetBeans 7.0.1 in this volume. This software can be installed and work only with Java 6

Then I tried to work with Eclipse. I've download last version of the IDE, and open the project. I get some compile errors (the parts of Java 1.6).

I went to Preferences -> Java -> Compiler->Compiler compliance level from 1.5 to 1.6

Then I get a message that says:

When selecting 1.6 compliance, make sure to have a compatible JRE installed and activated (currently 1.5) Configure

But when I try to change to 1.6

The selected JRE does not support the current compiler compliance level of 1.6

What I have to do to work with Java 1.6?

EDIT:

I've noticed that at

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

1.6 seems not to be installed

enter image description here

Upvotes: 1

Views: 1420

Answers (1)

Erik
Erik

Reputation: 3777

On OS X Leopard (10.5) the JDK 1.6 can only be used on 64bit-hardware (also in the Apple FAQ). If you are on a 32bit-hardware, you will not be able to run Java 1.6.

If you are on 64bit hardware, you can install it via SoftwareUpdate or via the Developer Tools. To select the running version of Java you can use the Java Preferences.

Here you will find a chart which (Apple)-JDK is running under which OS X version.

There is an "unofficial" port I have not tried: The project SoyLatte brings JDK 1.6 to OS X 10.4. and later - perhaps you can have a try with this.

Upvotes: 2

Related Questions