简体   繁体   中英

How to develop in Java on Mac with OSX Lion

Im a new Java developer and was thinking about getting a Mac. But I heard that OSX Lion does not support Java. Does that mean that I cannot develop Java on a Mac? Or that I just have to go get all the Java downloads myself?

What it means for right now, is nothing has changed, except that the JDK 6 and on is now a separate download via Software Update. For JDK 7 it will be available from Oracle, maybe even through the App Store if we are lucky!

What has happened is Apple has quit mangling their own JDK into the OS and delegating responsibility to Oracle to supply a JDK for OSX going forward . It isn't installed by default, but after the fact just like on every other platform other than Solaris . Arguably this will be a good thing, as the Apple JDK usually lags 6 months plus behind the official Sun/Oracle one. Having someone with a more vested interest in the technology on all the platforms is a good thing!

Original Press Release

As of the release of Java for Mac OS X 10.6 Update 3, the version of Java that is ported by Apple, and that ships with Mac OS X, is deprecated. This means that the Apple-produced runtime will not be maintained at the same level, and may be removed from future versions of Mac OS X. The Java runtime shipping in Mac OS X 10.6 Snow Leopard, and Mac OS X 10.5 Leopard, will continue to be supported and maintained through the standard support cycles of those products.

And the most recent relevant press release is ( I put the important points in BOLD )

REDWOOD SHORES and CUPERTINO, California—November 12, 2010—Oracle and Apple® today announced the OpenJDK project for Mac OS® X. Apple will contribute most of the key components, tools and technology required for a Java SE 7 implementation on Mac OS X, including a 32-bit and 64-bit HotSpot-based Java virtual machine, class libraries, a networking stack and the foundation for a new graphical client. OpenJDK will make Apple's Java technology available to open source developers so they can access and contribute to the effort.

“We are excited to welcome Apple as a significant contributor in the growing OpenJDK community ,” said Hasan Rizvi, Oracle's senior vice president of Development. “The availability of Java on Mac OS X plays a key role in the cross-platform promise of the Java platform. The Java developer community can rest assured that the leading edge Java environment will continue to be available on Mac OS X in the future. Combined with last month's announcement of IBM joining the OpenJDK, the project now has the backing of three of the biggest names in software.”

“We're delighted to be working with Oracle to insure that there continues to be a great version of Java on the Mac,” said Bertrand Serlet, Apple's senior vice president of Software Engineering. “The best way for our users to always have the most up to date and secure version of Java will be to get it directly from Oracle.”

Apple also confirmed that Java SE 6 will continue to be available from Apple for Mac OS X Snow Leopard® and the upcoming release of Mac OS X Lion . Java SE 7 and future versions of Java for Mac OS X will be available from Oracle.

My personal opinion is OSX is the premiere platform for Java development, and as long as Oracle doesn't drop the ball will just become even better.

I've just experienced this confusion/issue and I noticed that no-one in this question really gave the steps to get Java on Lion if you don't have any JARs or apps: If you want to prompt OS X to install the JVM, run the "Java Preferences" app in Applications > Utilities.

This will display a confirmation for "Install Java runtime" which will then cause Software Update to do its magic

All the 'lack of Java support' means is that Lion doesn't install a JVM. But when you need it, the JVM gets installed.

I've just installed Lion and at the first reboot was prompted to install the JVM.

The latter. Java is not included anymore by default in Mac Os X 10.7 Lion.

You can still install it using the Software update program. It also downloads Java automatically in a variety of scenario's (though I don't know which)

Java 6 is not installed by default in Lion, but was download by the Software Update after I tried to launch my muCommander.

What is incredibly good, is that all Swing and SWT apps look very well in Lion (including NetBeans and Eclipse), already using the new look and feel Lion has (more squared buttons, simpler scrollbars, etc).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM