好吧,所以,经过一番游戏之后,这就是我的理解…
- 下载Java Application Bundler并将其放置在
lib
项目目录中。您将需要创建此目录… - 在您的项目目录中创建一个新的Ant脚本,随时随地对其进行命名…此外,请花一些时间阅读
AppBundler
任务文档
蚂蚁脚本应基于以下框架…
<project name="ButtonDemo" default="bundle-buttonDemo" basedir="."> <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="lib/appbundler-1.0.jar" /> <!-- See the lib reference here, this is why you need to use the lib directory! --> <target name="bundle-buttonDemo"> <delete dir="appBundle" failonerror="false"/> <mkdir dir="appBundle"/> <bundleapp outputdirectory="appBundle" name="ButtonDemo" displayname="Button Demo" identifier="components.ButtonDemo" mainclassname="components.ButtonDemo"> <!-- The following is important and should point to your build --> <classpath file="dist/ButtonDemo.jar" /> <!-- You can have multiple instance of classpath if you 3rd party or dependent jars in different locations --> </bundleapp> </target></project>
- 建立你的项目
- 使用(类似)运行ant脚本
ant -f {You App Bundler script}
在这种情况下,应用程序捆绑包
ButtonDemo.app将在
appBundle目录中创建。如果可以的话,浏览的内容,
ButtonDemo.app/Contents/Java并确保所有必需的Jar文件都在其中…
捆绑愉快!
根据更新的build.xml文件进行更新
1- 标签未
default指定目标
project。将此视为您的“主类”或“主”方法,没有,蚂蚁不知道您要运行什么…
<project name="Rage Mage" basedir="." default="bundle-RageMage">
2-
name的
taskdef是显著,你用它在任何脚本,以确定当它击中你的标记参考蚂蚁应该做些什么?
因此,根据您的示例,您需要将的名称
taskdef从更改
ragemage为
bundleapp或将
bundleapp标记更改为
ragemage…
要么改变这个…
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="lib/appbundler-1.0.jar" />
或这个(在目标中
bundle-RageMage)
<ragemage outputdirectory="bundle" name="Rage Mage" displayname="Rage Mage" icon="res/icon.icns" identifier="ragemage.src.Window" mainclassname="ragemage.src.Window"> <classpath file="dist/ragemage_1.1.1.jar" /></ragemage>
就个人而言,我将其保留为
bundleapp,但这就是我…
3-
delete,
mkdir和
outputdirectory属性
bundleapp都与…
<delete dir="appBundle" failonerror="false"/><mkdir dir="appBundle"/><bundleapp outputdirectory="bundle"...
要么,让他们全部
appBundle或
bundle,每次你想要什么?
4-您的主要班级不太可能出现
ragemage.src.Window并且可能会成为
Window



