简体   繁体   English

运行Ant脚本时出错

[英]Error running ant script

I'm trying to run an ant script from my Vagrantfile, and I get this error: 我正在尝试从我的Vagrantfile运行一个蚂蚁脚本,但出现此错误:

==> vm: Running provisioner: host_shell...
[stderr] Error: Could not find or load main class org.apache.tools.ant.launch.Launcher

I have java 1.8.0_161 and ant 1.8.2 我有Java 1.8.0_161和ant 1.8.2

and have in my .bash_profile: 并在我的.bash_profile中:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
export ANT_HOME=/Users/.../ant
export PATH="$PATH:$ANT_HOME/bin"

I've looked through all other relevant posts, and can't find a solution. 我已经浏览了所有其他相关的帖子,但是找不到解决方案。 My situation is a little different in that I'm using ant which came in a software package I have to use for work, rather than installed with brew or downloaded from apache. 我的情况有所不同,因为我使用的是ant,该软件包是我必须用于工作的软件包,而不是随brew安装或从apache下载。 I noticed the $ANT_HOME/lib folder has all .pom files instead of .jar files, which I'm guessing might be part of the problem. 我注意到$ ANT_HOME / lib文件夹包含所有.pom文件而不是.jar文件,我猜这可能是问题的一部分。 This is my first time using ant and have never used maven. 这是我第一次使用ant,从未使用过maven。

also here is the provisioning section of my Vagrantfile: 这也是我的Vagrantfile的配置部分:

iiq.vm.provision :host_shell do |host_shell|
  host_shell.inline = './build.sh initial-build'
end

Thanks for any help! 谢谢你的帮助!

疑似我缺少适当的.jar文件

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

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