我正在尝试使用.jar将我的MacOSX应用包捆绑到一个MacOSX应用包中。我正在学习本教程。
它说要向高级项目目录中添加一个lib文件夹,但我不知道这意味着什么。我一直在到处找它,但我找不到它是什么。这是我唯一的问题,有人知道吗?
编辑:
这是我的build.xml文件:
<project name="Rage Mage" basedir=".">
<taskdef name="ragemage"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="lib/appbundler-1.0.jar" />
<target name="bundle-RageMage">
<delete dir="appBundle" failonerror="false"/>
<mkdir dir="appBundle"/>
<bundleapp 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" />
</bundleapp>
</target>
谢谢!
发布于 2014-07-28 10:02:05
好吧,在玩了一会儿之后,这就是我理解的.
lib目录中。你需要创建这个目录..。蚂蚁脚本应该基于以下骨架..。
<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 -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 of taskdef非常重要,您可以在任意脚本中使用它来确定ant在访问标记引用时应该做什么.
因此,根据您的示例,您需要将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。
https://stackoverflow.com/questions/24978212
复制相似问题