java - 我在 ant 中使用应用程序 bundler 时遇到错误

标签 java macos ant app-bundle

当我要在 ant 中使用应用程序 bundler 创建 .app 文件时,会出现以下错误:

/Users/vijaygupta/NetBeansProjects/Screen Grabber/build.xml:14: Problem: failed to create task or type bundleapp
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

我的 build.xml 文件是:

<?xml version="1.0" encoding="UTF-8"?>
<project name="Screen_Project" default="default" basedir=".">        
<import file="nbproject/build-impl.xml"/>

<taskdef name="Screen_Project"
         classname="com.oracle.appbundler.AppBundlerTask"   
         classpath="lib/appbundler-1.0.jar" />

<target name="ScreenProject">
    <bundleapp outputdirectory="dist"
        name="ScreenProject"
        displayname="ScreenGrabber"
        identifier="Main.MainIconPage"
        mainclassname="Main.MainIconPage">
        <classpath file="dist/Screen_Project.jar" />
    </bundleapp>
</target>

</project>

最佳答案

问题是您的 build.xml 不包含bundleapp 标记的taskdef。从上面的示例可以清楚地看出,您已将其更改为 Screen_Project,并且只需将 taskdef 替换为以下内容即可:

<taskdef name="bundleapp"
     classname="com.oracle.appbundler.AppBundlerTask"   
     classpath="lib/appbundler-1.0.jar" />

关于java - 我在 ant 中使用应用程序 bundler 时遇到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14952452/

相关文章:

java - 数据库多表和 ICS

java - 无法通过 ant 命令 JAVA_HOME 定位 tools.jar 并且为 jdk 而不是 jre 设置了 PATH

linux - Linux下用hudson编译资源包报错: null,

java - 从 jar 文件加载属性文件时出错

java - 面向对象设计——何时使用 getClass 和 instanceof

macos - 在没有帮助程序的情况下以特权运行应用程序

node.js - 如何在 Mac M1 芯片组上使用 NVM 安装旧版本的 Node.js

android - 将 Doclava 与 Ant 和 Android 一起使用

java - 将 CXF SOAP Web 服务部署到 Apache Tomcat

java - 是否可以在没有官方 oracle dmg 文件的情况下在 mac os x 上安装 JDK 7 或 8?