Apache Ant的1.8在CentOS [英] Apache Ant 1.8 on CentOS
问题描述
我想获得Apache Ant的1.8 CentOS的下工作。首先,我有这个错误。
I am trying to get apache ant 1.8 to work under CentOS. First, I had this error.
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
然后我根据这个链接设置下列变量
<一个href=\"http://stackoverflow.com/questions/4214979/ant-exception-in-thread-main-java-lang-noclassdeffounderror-org-apache-tools\">Ant:异常螺纹&QUOT;主&QUOT; java.lang.NoClassDefFoundError的:组织/阿帕奇/工具/ ANT /启动/启动
Ant: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher
这不是CentOS的,但我没有验证JAVA_HOME除外存在的路径,所以我就按照这个站点设置:
It's not CentOS, but I did verify the paths exist except JAVA_HOME, so I set it according to this site:
<一个href=\"http://serverfault.com/questions/50883/what-is-the-value-of-java-home-for-centos\">http://serverfault.com/questions/50883/what-is-the-value-of-java-home-for-centos
现在我收到了同样的错误,我做了第一次。不要紧,我使用的蚂蚁规则,我仍然得到同样的错误。
Now I am getting the same error I did the first time. It does not matter which ant rule I use, I still get the same error.
[alpha:~]
[bullshark]% export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/
[alpha:~]
[bullshark]% export ANT_HOME=/usr/share/ant/
[alpha:~]
[bullshark]% export PATH=$PATH:$ANT_HOME/bin
[alpha:~]
[bullshark]% cd JRobo
[alpha:JRobo] on master
[bullshark]% ant clean-and-fat-jar
Picked up _JAVA_OPTIONS: -Xmx64m
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
[alpha:JRobo] on master
[bullshark]% cat /etc/redhat-release
CentOS release 6.3 (Final)
[alpha:JRobo] on master
[bullshark]%
您可以复制他在CentOS,如果你也想尝试:
You can clone him on CentOS if you want to try:
https://github.com/BullShark/JRobo
有关CentOS的Apache Ant的1.8:
For Apache Ant 1.8 on CentOS:
http://www.jpackage.org/browser /rpm.php?jppversion=6.0&id=11867
有关包或手动:
的https://ant.apache.org/bindownload.cgi?$p$pferred=ftp://apache.mirrors.pair.com/
推荐答案
下面是必需的步骤获得蚂蚁1.8安装在CentOS:
Here are the steps required to get ant 1.8 installed on CentOS:
- 下载<一个href=\"http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.4-bin.tar.gz\">http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.4-bin.tar.gz
- 压缩包复制到你的CentOS的主文件夹(如果它尚不存在)
-
焦油xvzf的apache-ANT-1.8.4-bin.tar.gz
-
sudo的MV Apache的ANT-1.8.4的/ opt /蚂蚁
- 设置ANT_HOME = /选择/蚂蚁
- 添加
导出ANT_HOME = /选择/蚂蚁
来/ etc / profile文件
- Download http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.4-bin.tar.gz
- Copy the tarball to your CentOS home folder (if it's not already there)
tar xvzf apache-ant-1.8.4-bin.tar.gz
sudo mv apache-ant-1.8.4 /opt/ant
- Set ANT_HOME=/opt/ant
- Add ‘
export ANT_HOME=/opt/ant
’ to/etc/profile
要验证它的工作,运行:
To verify that it worked, run:
ant -version
这篇关于Apache Ant的1.8在CentOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!