栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

带有应用捆绑器的Jar to Mac OSX App Bundle

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

带有应用捆绑器的Jar to Mac OSX App Bundle

好吧,所以,经过一番游戏之后,这就是我的理解…

  • 下载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



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/573698.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号