我正在尝试编译一个在 linux 上使用 apache ant 的工具
https://github.com/lindenb/jvarkit
当我尝试编译该工具时,出现了 n 个错误。
$ make vcffilterjs
这是我运行命令时得到的结果
echo "Compiling htsjdk with ${JAVA_HOME} = /usr/lib/jvm/java/jre/"
Compiling htsjdk with /usr/lib/jvm/java/jre/ = /usr/lib/jvm/java/jre/
echo "Compiling htsjdk library for java. Requires apache ANT. If it fails here, it's a not a problem with jvarkit."
Compiling htsjdk library for java. Requires apache ANT. If it fails here, it's a not a problem with jvarkit.
echo "And ${JAVA_HOME}/bin/javac should be >=1.7"
And /usr/lib/jvm/java/jre//bin/javac should be >=1.7
(cd /home/jannahS/jvarkit/htsjdk-1.139 && ant )
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
make: *** [/home/jannahS/jvarkit/htsjdk-1.139/dist/htsjdk-1.139.jar] Error 1
我已经安装了 apache ant 并尝试按照 google 指令设置 ANT_HOME
export ANT_HOME=apache-ant-1.9.6
ANT_OPTS="-Xms256M -Xmx512M"
PATH=$PATH:$HOME/bin:$ANT_HOME/bin
export ANT_HOME ANT_OPTS PAT
我也设置了JAVA_HOME
export JAVA_HOME=/usr/lib/jvm/jre-1.7.0
export PATH=$JAVA_HOME/jre/bin:$PATH
当我运行时
Ant --execdebug
exec "/usr/lib/jvm/java/jre//bin/java" -Xmx256M -classpath "apache-ant- 1.9.6/lib/ant-launcher.jar" -Dant.home="apache-ant-1.9.6" -Dant.library.dir="apache-ant-1.9.6/lib" org.apache.tools.ant.launch.Launcher -cp ""
Buildfile: build.xml does not exist!
Build failed
我不知道还能做什么才能使事情正常进行。没有apache ant我无法编译我想使用的工具
最佳答案
在 ANT_HOME 中使用完整路径,例如:
export ANT_HOME=/usr/lib/apache-ant-1.9.6
这取决于它的确切位置
关于java - apache ant 无法找到或加载主类 org.apache.tools.ant.launch.Launcher,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33603454/