简介:我对ant很新,我正在使用预先存在的.xml
file构建jar。
问题:我必须为其构建过程编写脚本,因此尝试在终端中运行它。在发出以下错误后,ant构建失败:
default:
[taskdef] Could not load definitions from resource com/sun/javafx/tools/ant/antlib.xml. It could not be found.
BUILD FAILED
Problem: failed to create task or type javafx:com.sun.javafx.tools.ant:application
Cause: The name is undefined.
可能的原因: 我环顾了一会儿,我想这可能是一个图书馆问题。 Javafx随Oracle提供的JAVA一起提供,在OpenJDK 7中不可用。该文件中的相关代码如下,整个文件可以找到here:
<property name="targetDir" value="${basedir}/../../Documents/ReactomeBuild/CuratorToolBuildFiles" />
<target name="default">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
xmlns:fx="javafx:com.sun.javafx.tools.ant"
uri="javafx:com.sun.javafx.tools.ant"
classpath="${targetDir}:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/lib/ant-javafx.jar"/>
... some more code
我在做什么: 我想也许我应该得到javafx的jar文件但找不到它。我不知道我的方法是否正确。如果有任何官方链接到javafx.jar文件,请告诉我。
答案 0 :(得分:1)
OpenJDK 7在Ubuntu 16.04中不支持。您要么必须将操作系统降级到Ubuntu 14.04,要么将OpenJDK 7升级到OpenJDK 8.很可能你用来在Ubuntu 16.04中安装OpenJDK 7的ppa是过时的而不是维护的。