macos 如何使用 OSX Lion 在 Mac 上用 Java 进行开发

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6765905/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 08:11:25  来源:igfitidea点击:

How to develop in Java on Mac with OSX Lion

javamacososx-lion

提问by Ian

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?

我是一名新的 Java 开发人员,正在考虑购买 Mac。但听说 OSX Lion 不支持 Java。这是否意味着我不能在 Mac 上开发 Java?或者我只需要自己去获取所有的 Java 下载?

回答by

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!

它现在的意思是,没有任何变化,除了 JDK 6 及更高版本现在是通过软件更新单独下载。对于 JDK 7,它可以从 Oracle 获得,如果幸运的话甚至可以通过 App Store 获得!

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!

发生的事情是 Apple 已经停止将他们自己的 JDK 整合到操作系统中,并将责任委托给 Oracle,以便为未来的 OSX 提供 JDK。它不是默认安装的,但事后就像在除 Solaris 之外的所有其他平台上一样。可以说这是一件好事,因为 Apple JDK 通常比 Sun/Oracle 官方的 JDK 滞后 6 个月以上。拥有对所有平台上的技术更感兴趣的人是一件好事!

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.

在 Java for Mac OS X 10.6 Update 3 发布时,Apple 移植并随 Mac OS X 一起提供的 Java 版本已被弃用。这意味着 Apple 生产的运行时不会保持在同一级别,并且可能会从 Mac OS X 的未来版本中删除。 Mac OS X 10.6 Snow Leopard 和 Mac OS X 10.5 Leopard 中的 Java 运行时将继续通过这些产品的标准支持周期得到支持和维护。

And the most recentrelevant press releaseis ( I put the important points in BOLD)

最近的相关新闻稿是(我把重要的点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.

加利福尼亚州红木海岸和库比蒂诺——2010 年 11 月 12 日——甲骨文和苹果?今天宣布了 Mac OS 的 OpenJDK 项目?X. Apple 将贡献在 Mac OS X 上实现 Java SE 7 所需的大部分关键组件、工具和技术,包括 32 位和 64 位基于 HotSpot 的 Java 虚拟机、类库、网络堆栈和新图形客户端的基础。OpenJDK 将使开源开发人员可以使用 Apple 的 Java 技术,以便他们可以访问并为这项工作做出贡献。

“我们很高兴欢迎Apple 成为不断增长的 OpenJDK 社区的重要贡献者,”甲骨文开发高级副总裁 Hasan Rizvi 说。“Java 在 Mac OS X 上的可用性在 Java 平台的跨平台承诺中起着关键作用。Java 开发人员社区可以放心,未来将继续在 Mac OS X 上使用领先的 Java 环境。加上上个月 IBM 宣布加入 OpenJDK,该项目现在得到了软件界三大巨头的支持。”

“我们很高兴与 Oracle 合作,以确保 Mac 上继续有优秀的 Java 版本,”Apple 软件工程高级副总裁 Bertrand Serlet 说。“让我们的用户始终拥有最新且安全的 Java 版本的最佳方式是直接从 Oracle 获取。”

Apple 还确认Java SE 6 将继续从 Apple 提供用于 Mac OS X Snow Leopard?以及即将发布的 Mac OS X Lion。适用于 Mac OS X 的 Java SE 7 和未来版本的 Java 将从 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.

我个人的看法是 OSX 是 Java 开发的首选平台,只要 Oracle 不丢球,它就会变得更好。

回答by David Roberts

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.

我刚刚经历了这个困惑/问题,我注意到如果你没有任何 JAR 或应用程序,这个问题中没有人真正给出了在 Lion 上获取 Java 的步骤:如果你想提示 OS X 安装 JVM ,在“应用程序”>“实用程序”中运行“Java 首选项”应用程序。

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

这将显示“安装 Java 运行时”的确认信息,这将导致软件更新发挥其魔力

回答by Steve Morgan

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

所有“缺乏 Java 支持”都意味着 Lion 没有安装 JVM。但是当你需要它时,JVM 就会被安装。

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

我刚刚安装了 Lion 并且在第一次重新启动时被提示安装 JVM。

回答by dtech

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

后者。默认情况下,Mac Os X 10.7 Lion 中不再包含 Java。

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(虽然我不知道是哪个)

回答by ebasconp

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

默认情况下,Lion 中未安装 Java 6,而是在我尝试启动 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).

令人难以置信的是,所有 Swing 和 SWT 应用程序在 Lion(包括 NetBeans 和 Eclipse)中看起来都非常好,已经使用了 Lion 的新外观(更多方形按钮、更简单的滚动条等)。