简体   繁体   English

用Ant构建jar文件(htsjdk jar)

[英]Building jar file (htsjdk jar) with Ant

HTSJDK is a library for accessing common file formats, such as SAM and VCF. HTSJDK是用于访问常见文件格式(例如SAM和VCF)的库。 I want to build the HTSJDK jar. 我想构建HTSJDK jar。 In the documentation page says that I have to use Ant for that. 在文档页面中说,我必须为此使用Ant。 So I installed Ant and run the command: 所以我安装了Ant并运行命令:

ant htsjdk-jar 蚂蚁htsjdk-jar

But I get this error: 但是我得到这个错误:

compile-samtools: compile-samtools:

[javac] /home/usr/Documents/samtools-htsjdk/build.xml:241: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; [javac] /home/usr/Documents/samtools-htsjdk/build.xml:241:警告:未设置'includeantruntime',默认为build.sysclasspath = last; set to false for repeatable builds 为可重复的构建设置为false

[javac] Compiling 410 source files to /home/usr/Documents/samtools-htsjdk/classes [javac]将410个源文件编译到/ home / usr / Documents / samtools-htsjdk / classes

[javac] javac: invalid target release: 1.8 [javac] javac:无效的目标版本:1.8

[javac] Usage: javac <options> <source files> [javac]用法:javac <选项> <源文件>

[javac] use -help for a list of possible options [javac]使用-help列出可能的选项

BUILD FAILED 建立失败

/home/usr/Documents/samtools-htsjdk/build.xml:96: The following error occurred while executing this line: /home/usr/Documents/samtools-htsjdk/build.xml:96:执行此行时发生以下错误:

/home/usr/Documents/samtools-htsjdk/build.xml:241: Compile failed; /home/usr/Documents/samtools-htsjdk/build.xml:241:编译失败; see the compiler error output for details. 有关详细信息,请参见编译器错误输出。

There is something wrong with the build.xml file. build.xml文件出问题了。 Here it is the beginning of the file: 这是文件的开头:

<?xml version="1.0"?>

<project name="htsjdk" basedir="." default="all">

    <property name="src" value="src/java"/>
    <property name="src.test" value="src/tests"/>
    <property name="src.test.java" value="${src.test}/java"/>
    <property name="lib" value="lib"/>
    <property name="dist" value="dist"/>
    <property name="classes" value="classes"/>
    <property name="classes.test" value="testclasses"/>
    <property name="scripts" value="src/scripts"/>
    <property name="test.output" value="dist/test"/>

    <property name="javac.target" value="1.8"/>
    <property name="javac.debug" value="true"/>

    <!-- Get GIT hash, if available, otherwise leave it blank.  -->

    <property name="repository.revision" value=""/>
    <property name="htsjdk-version" value="2.0.1"/>
    <property name="htsjdk-version-file" value="htsjdk.version.properties"/>
    <property name="testng.verbosity" value="2"/>
    <property name="test.debug.port" value="5005" />  <!-- override on the command line if desired -->

Please, can someone tell me what to do to solve this problem? 拜托,有人可以告诉我该怎么做吗?

The javac task in the build.xml (which tells ant what to do) specifies a Java target version of 1.8 (which means Java 8). build.xml中的javac任务(告诉ant做什么)指定了Java目标版本1.8(即Java 8)。 Seems like you are trying to compile with a lower Java version. 似乎您正在尝试使用较低的Java版本进行编译。 You can check your installed Java version using javac -version . 您可以使用javac -version检查已安装的Java版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM