用于 Apple M1 芯片的 Java/JDK [英] Java/JDK for the Apple M1 chip

查看:117
本文介绍了用于 Apple M1 芯片的 Java/JDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否需要一个特殊版本的 OpenJDK 来支持新的 Apple M1 芯片?

Will there need to be a special release of OpenJDK to support the new Apple M1 chip?

我看到目前有适用于 macOS/OS X 的 JDK 下载,但这些似乎只适用于 x86 处理器.那是对的吗?如果是这样,我在哪里可以下载 M1 的 OpenJDK 版本?

I see that there are currently downloads of the JDK for macOS/OS X, but these seem to only be for x86 processors. Is that correct? If so, where can I download a version of OpenJDK for the M1?

推荐答案

是.

在此页面上:AdoptOpenJDK 最新版本 您可以从操作系统"中选择macOS"下拉菜单,然后从架构"中,它目前只有 x64,但很快就会有 AArch64 或 ARM64(这些通常是 64 位 ARM 的简码).可能是因为 Apple 无疑在其 M1 设计中内置了大量扩展,而 Apple 也有自己的扩展.

On this page: AdoptOpenJDK Latest Releases you can select 'macOS' from the 'Operating System' dropdown, and then from 'Architecture', it's currently only x64, but soonish there should be AArch64 or ARM64 (those are usually the shortcodes for 64-bit ARM). Possibly, as Apple no doubt has a bunch of extensions built into their M1 designs, and Apple gets its own.

如果您将操作系统保留为any",您会注意到 aarch64 在其中,这将使您获得适用于 ARM 处理器的 Linux 版本.这(可能)不会在 M1 硬件上的 macOS 上运行,但已经完成了 95% 的工作.

If you instead leave Operation System on 'any', you'll note aarch64 is in there, and this gets you to a Linux release for ARM processors. That (probably) won't run on macOS on M1 hardware, but that's 95% of the work already done.

所以:目前还没有,但请注意 ARM 的 JDK 已经可用了十多年,而 JDK 15 已经放弃了对一系列异国操作系统/架构组合的支持(例如 Solaris),ARM 开发始终至少保持部分相关性(即使到目前为止它主要是 Oracle 商业许可)供).也就是说:创建一个原生运行在M1s上的adoptopenjdk版本不应该是一项艰巨的努力,所以想必,它会发生.但是,这是一项开源工作,因此,如果您感到焦虑,请务必阅读并做出贡献:)

So: It's not there yet, but note that JDKs for ARM have been available for more than decade, and whilst JDK 15 has dropped support for a bunch of exotic OS/architecture combinations (such as Solaris), ARM development has always remained at least partially relevant (even if so far it's mostly an Oracle commercial license offering). That is to say: It should not be a herculean effort to create an adoptopenjdk release that runs on M1s natively, so presumably, it will happen. But, it's an open source effort, so if you're anxious, by all means, read up and contribute :)

Apple 直到 2020 年 11 月 10 日才提供有关此架构的任何详细信息,除非您为其购买了开发套件(a Mac Mini 带有 A14 芯片,这不是 M1 芯片,但我猜已经足够接近了),并签署了一个大 保密协议.

Apple has not given any details on this architecture whatsoever until November 10th 2020, unless you bought a development kit box for it (a Mac Mini with an A14 chip, which isn't an M1 chip, but close enough I guess), and signed a big NDA.

通常,如果你挥舞 NDA,开源项目会尽可能快地朝着相反的方向运行,所以如果你不喜欢这种状态,我认为抱怨采用 openjdk 或其他打包器是不明智的和关于它的开源项目:)

As a rule, open source projects will run as fast as possible in the opposite direction if you wave an NDA around, so if you dislike this state of affairs, I don't think it's wise to complain to adoptopenjdk or other packagers and open source projects about it :)

幸运的是,现在已经结束,不再需要保密协议.我的假设是,一旦熟悉 OpenJDK 源代码的人拥有一个基于 M1 的 macOS 系统来测试它,OpenJDK 源代码的 ARM 分支 + macOS x64 版本中已经存在的 macOS 位可以很容易地组合起来,这应该意味着应该在一个月内发布一个采用 openjdk macos-aarch64 的版本.

Fortunately, now it's out, and an NDA is no longer required. My assumption is that the ARM branch of the OpenJDK source code + the macOS bits that already exist for the macOS x64 release can be combined rather easily once someone with some familiarity with the OpenJDK source code has an M1-based macOS system to test it on, which should mean an adoptopenjdk macos-aarch64 release should be here within the month.

但是,开源.你没有付钱给他们,你没有合同,他们也不欠你的.如果您希望它运行得更快,请捐款或贡献拉取请求.

But, open source. You didn't pay them, you have no contract, and they don't owe it to you. Donate to the effort or contribute a pull request if you want it to go faster.

更新:

  • Azul 的 M1OpenJDK 构建
  • 微软的(是的,真的)GitHub 源代码库 用于在 AArch64 上为 macOS 早期访问 OpenJDK16 构建.请注意,Microsoft 一直致力于 AArch64 的 OpenJDK 分支(适用于基于 ARM 的 Windows 10),这可以追溯到:已经完成了许多艰苦的工作.
  • Azul's M1 OpenJDK builds
  • Microsoft's (yes, really) GitHub source repo for an early access OpenJDK16 build for macOS on AArch64. Note that Microsoft's been working on the OpenJDK branch of AArch64 (for ARM-based Windows 10) for a while, which goes back to: A lot of the hard work was already done.

这篇关于用于 Apple M1 芯片的 Java/JDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆