简体   繁体   中英

Building jar file (htsjdk jar) with Ant

HTSJDK is a library for accessing common file formats, such as SAM and VCF. I want to build the HTSJDK jar. In the documentation page says that I have to use Ant for that. So I installed Ant and run the command:

ant htsjdk-jar

But I get this error:

compile-samtools:

[javac] /home/usr/Documents/samtools-htsjdk/build.xml:241: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

[javac] Compiling 410 source files to /home/usr/Documents/samtools-htsjdk/classes

[javac] javac: invalid target release: 1.8

[javac] Usage: javac <options> <source files>

[javac] use -help for a list of possible options

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:241: Compile failed; see the compiler error output for details.

There is something wrong with the build.xml file. 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). Seems like you are trying to compile with a lower Java version. You can check your installed Java version using javac -version .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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