将Java应用程序转换为Mac OS X应用程序

时间:2021-04-23 16:47:58

Is there a way to convert a Java application into a Mac OS X executable app?

有办法把Java应用程序转换成Mac OS X可执行应用程序吗?

I use NetBeans to develop in Java, and I'd like to "pack" the "dist" folder into an app (just for convenience)

我使用NetBeans在Java中进行开发,我想将“dist”文件夹“打包”到一个应用程序中(只是为了方便)

5 个解决方案

#1


13  

Use the Apple Java Extensions and its Guide

The Apple Java Extensions contains a very complete development guide with information on the deployment of Java applications on Mac OS X and the production of application bundles. It also introduces other aspects of the Apple Java Extensions, like the support for integration with the standard Mac OS X UI.

Apple Java扩展包含一个非常完整的开发指南,其中包含了关于在Mac OS X上部署Java应用程序和生产应用程序包的信息。它还介绍了苹果Java扩展的其他方面,比如对与标准Mac OS X UI集成的支持。

Other references:

#2


11  

There is a library that let's you package your Java app
Packr: https://github.com/libgdx/packr

有一个库让我们打包Java应用程序Packr: https://github.com/libgdx/packr

Packages your JAR, assets and a JVM for distribution on Windows (ZIP), Linux (ZIP) and Mac OS X (.app), adding a native executable file to make it appear like the app is a native app.

将您的JAR、资产和JVM打包在Windows (ZIP)、Linux (ZIP)和Mac OS X (.app)上,添加一个本机可执行文件,使其看起来像一个本地应用程序。

It can even minimize the JRE for you.

它甚至可以最小化JRE。

#3


2  

jar2app

jar2app

Packr is a great tool, but at the time I found that I wanted something "easier to use", so jar2app was born. I know this is an old question but perhaps other people might find this program easier to use than other alternatives. If they don't, there's a direct reference in the FAQ to other alternatives (such as Packr).

Packr是一个很棒的工具,但是当时我发现我想要更容易使用的东西,所以jar2app诞生了。我知道这是一个老问题,但也许其他人会发现这个程序比其他的选择更容易使用。如果他们不这样做,FAQ中就会直接提到其他替代方案(如Packr)。

#4


1  

You can use javapackager tool to build the application and wrap it in into an installer, the following commands show how to convert a jar file into a bundle file:

您可以使用javapackager工具构建应用程序并将其打包到安装程序中,下面的命令显示如何将jar文件转换为bundle文件:

commands

mkdir -p package/macosx
cp Test.icns package/macosx
jdk=$(/usr/libexec/java_home)
$jdk/bin/javapackager -deploy -native dmg \
   -srcfiles Test.jar -appclass package.Test -name Test \
   -outdir deploy -outfile Test -v
cp deploy/bundles/Test-1.0.dmg installer.dmg
ls -l
open installer.dmg

To change the application icon and more info MacJava.

要更改应用程序图标和更多的MacJava信息。

#5


-1  

You can try this app , it bundles your jar file into Mac app

你可以试试这个应用,它把你的jar文件打包到Mac应用中

Edit: it's easy to use , select the Jar file and an Icon. Here you can see the screen shoot.

编辑:很容易使用,选择Jar文件和一个图标。在这里你可以看到屏幕截图。

https://github.com/aprsn/Mac-App-Creator

https://github.com/aprsn/Mac-App-Creator

#1


13  

Use the Apple Java Extensions and its Guide

The Apple Java Extensions contains a very complete development guide with information on the deployment of Java applications on Mac OS X and the production of application bundles. It also introduces other aspects of the Apple Java Extensions, like the support for integration with the standard Mac OS X UI.

Apple Java扩展包含一个非常完整的开发指南,其中包含了关于在Mac OS X上部署Java应用程序和生产应用程序包的信息。它还介绍了苹果Java扩展的其他方面,比如对与标准Mac OS X UI集成的支持。

Other references:

#2


11  

There is a library that let's you package your Java app
Packr: https://github.com/libgdx/packr

有一个库让我们打包Java应用程序Packr: https://github.com/libgdx/packr

Packages your JAR, assets and a JVM for distribution on Windows (ZIP), Linux (ZIP) and Mac OS X (.app), adding a native executable file to make it appear like the app is a native app.

将您的JAR、资产和JVM打包在Windows (ZIP)、Linux (ZIP)和Mac OS X (.app)上,添加一个本机可执行文件,使其看起来像一个本地应用程序。

It can even minimize the JRE for you.

它甚至可以最小化JRE。

#3


2  

jar2app

jar2app

Packr is a great tool, but at the time I found that I wanted something "easier to use", so jar2app was born. I know this is an old question but perhaps other people might find this program easier to use than other alternatives. If they don't, there's a direct reference in the FAQ to other alternatives (such as Packr).

Packr是一个很棒的工具,但是当时我发现我想要更容易使用的东西,所以jar2app诞生了。我知道这是一个老问题,但也许其他人会发现这个程序比其他的选择更容易使用。如果他们不这样做,FAQ中就会直接提到其他替代方案(如Packr)。

#4


1  

You can use javapackager tool to build the application and wrap it in into an installer, the following commands show how to convert a jar file into a bundle file:

您可以使用javapackager工具构建应用程序并将其打包到安装程序中,下面的命令显示如何将jar文件转换为bundle文件:

commands

mkdir -p package/macosx
cp Test.icns package/macosx
jdk=$(/usr/libexec/java_home)
$jdk/bin/javapackager -deploy -native dmg \
   -srcfiles Test.jar -appclass package.Test -name Test \
   -outdir deploy -outfile Test -v
cp deploy/bundles/Test-1.0.dmg installer.dmg
ls -l
open installer.dmg

To change the application icon and more info MacJava.

要更改应用程序图标和更多的MacJava信息。

#5


-1  

You can try this app , it bundles your jar file into Mac app

你可以试试这个应用,它把你的jar文件打包到Mac应用中

Edit: it's easy to use , select the Jar file and an Icon. Here you can see the screen shoot.

编辑:很容易使用,选择Jar文件和一个图标。在这里你可以看到屏幕截图。

https://github.com/aprsn/Mac-App-Creator

https://github.com/aprsn/Mac-App-Creator