无法捆绑适用于Mac的Java应用程序1.8 [英] Failed to bundle Java application 1.8 for Mac

查看:77
本文介绍了无法捆绑适用于Mac的Java应用程序1.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Java应用程序导出到Mac.该应用程序基于Compiler Complience Level 1.7.我尝试了其他方法来捆绑应用程序.

I am trying to export my Java Application to Mac. The application is based on Compiler Complience Level 1.7. I tried different methods to bundle the application.

1)Eclipse.我可以在Eclipse上导出的JVM的最新版本是1.6 *.

1) Eclipse. The latest version of JVM that I can use to export on Eclipse is 1.6*.

2)Maven.看起来在Maven上也存在相同的问题.当我使用以下命令时,它显示了与版本相关的错误

2) Maven. It looks like on Maven also the same problem exists. As when I used following command it showed a version related error.

系统:

~Jack$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode).

Maven方法

Maven命令

mvn package osxappbundle:bundle -DmainClass=com.example.Main

Maven返回的错误

Errors that Maven returns

type javax.swing.JList does not take parameters

cannot access org.json.JSONArray
   bad class file: org/json/JSONArray.class(org/json:JSONArray.class)
   class file has wrong version 52.0, should be 50.0

*我知道这些错误与Java版本有关.我的编译器是1.7,但是当我使用maven捆绑它时,将显示上述错误.

*I know these errors are related to the version of Java. My compiler is 1.7 but when I use maven to bundle it, above errors will be shown.

Eclipse方法

Version: Luna Service Release 1a (4.4.1)

我该怎么办?我可以找到其他替代方案,例如JarBundler,但没有用.

推荐答案

在OS X中创建Java应用程序捆绑包的新推荐方法是使用Oracle的

The new recommended way to create Java application bundles in OS X is to use Oracle's appbundler. This is Ant-based.

还有一个叉子,它提供了一些额外的功能.

There is also a fork which provides some extra functionality.

这篇关于无法捆绑适用于Mac的Java应用程序1.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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