且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Mac App Store 是否接受用 Python/Java/Ruby 编写的应用程序?

更新时间:2022-12-21 15:59:28

好消息

是的,您可以提交Java 应用到 Mac App Store.过去不是这样,但至少在 2013 年的现在是这样.

Yes, you can submit a Java app to the Mac App Store. Not true in the past, but it is true at least as of now in 2013.

一个例子是成功的 MoneyDance 个人理财应用程序,目前可在 Mac App Store 出售.

One example is the successful MoneyDance personal finance app currently available for sale in the Mac App Store.

坏消息

准备和提交您的应用既不简单也不容易.你必须跳过一些箍.

Preparing and submitting your app is neither simple nor easy. You have to jump through some hoops.

  • 您的应用不能依赖于安装在 Mac 上的 Java.您必须在 Mac 应用中包含 JRE(Java 运行时环境).
  • 您必须为 Java 应用编写一个精简的 Objective-C 包装器.源代码和示例/教程可在网上获得.
  • 与任何其他应用程序一样,您必须通过 Apple 要求的任何 Mac App Store 应用程序的安全限制来解决复杂的构建和部署繁琐的所有麻烦.

更多信息

  • Two articles, Take your Java application to the Mac App Store and Forking the OpenJDK for fun and profit, by Marco Dinacci. These articles may provide other useful information, but fortunately their discussion of forking the JDK is now outmoded. He and others have provided the needed patches now incorporated in the official releases.
  • How to Create a Mac OS X Installer for a Java Application (Updated for Mac OS X 10.8 — Mountain Lion) by Dem Pilafian of Center Key Software.
  • Packaging a Java App for Distribution on a Mac (Oracle)
  • Submitting to the Mac App Store (Apple)

顺便说一下,您可以同时使用 SwingJavaFX 在您的应用中.JavaFX 现在与 Java 捆绑在一起,至少从 Java 7 Update 40 开始,根据这些发行说明.

By the way, you can use both Swing and JavaFX in your app. JavaFX is now bundled with Java, at least as of Java 7 Update 40 according to these Release Notes.

新发布的 Java 9 应该使用运行时包装应用程序的过程变得更加容易和更好.

The newly released Java 9 should make this process of wrapping an app with a runtime even easier and better.

Java 9 带来了模块化",Java 平台模块系统 (JPMS),其中与 JVM 捆绑的大约 5,000 个类被分成大约一百个块,称为模块.您可以只包含包含您的特定应用程序实际使用的类的模块,而不是拖拽每个库.如果您不使用 JSONCORBA,那么您不需要包含 JSON 或 CORBA 相关模块.

Java 9 brings "modularization", Java Platform Module System (JPMS), where the approximately 5,000 classes bundled with a JVM are grouped into about a hundred chunks known as modules. You can include only the modules containing classes actually used by your particular app rather hauling along every library. If you don't use JSON or CORBA, then you need not include the JSON or CORBA related modules.

新的 jlink 工具为您完成这项工作,将一组模块及其依赖项组装和优化为自定义运行时映像.作为奖励,我们会执行一些链接时优化工作,以加快您的应用启动速度.

The new jlink tool does this work for you, to assemble and optimize a set of modules and their dependencies into a custom run-time image. As a bonus, some link-time optimization work is performed to make your app launch faster.

这些功能在 64 位 macOS 系统以及其他平台上均受支持.

These features are supported on 64-bit macOS systems, along with other platforms.

Java 9 还带来了对本机编译的新支持,以构建针对特定硬件优化的应用程序.但是这种能力是实验性的,还没有准备好用于生产.

Java 9 also brings new support for native compiling, to build an app optimized for specific hardware. But this ability is experimental, and not yet ready for production use.

Oracle 已经宣布结束网络部署技术,包括Java Web Start,之前推荐的桌面应用程序途径.所以现在,Oracle 希望所有 Java 应用程序都与 JVM 捆绑在一起交付,例如使用上述 jlink 工具完成的.

Oracle has announced the end of web deployment technology, including Java Web Start, the previously recommended avenue for desktop apps. So now, Oracle expects all Java apps to be delivered bundled with a JVM such as is done with the jlink tool mentioned above.

因此,使用 Java 运行时包装应用程序的过程现在已成为主流.Oracle 希望任何基于 Java 的桌面应用程序都能以这种方式安装.

So, the process of wrapping an app with a Java runtime that was something of a rarity just for the Apple App Store is now mainstream. Oracle expects any Java-based desktop app to be installed this way.