CentOS 上的 Apache Ant 1.8 [英] Apache Ant 1.8 on CentOS

查看:33
本文介绍了CentOS 上的 Apache Ant 1.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让 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

然后我根据这个链接设置了以下变量:

Then I set the following variables according to this link:

Ant:线程异常主要"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:

https://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/浏览器/rpm.php?jppversion=6.0&id=11867

对于包或手动:

https://ant.apache.org/bindownload.cgi?Preferred=ftp://apache.mirrors.pair.com/

推荐答案

以下是在 CentOS 上安装 ant 1.8 所需的步骤:

Here are the steps required to get ant 1.8 installed on CentOS:

  1. 下载http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.4-bin.tar.gz
  2. 将 tarball 复制到您的 CentOS 主文件夹(如果它还没有)
  3. tar xvzf apache-ant-1.8.4-bin.tar.gz
  4. sudo mv apache-ant-1.8.4/opt/ant
  5. 设置 ANT_HOME=/opt/ant
  6. 将‘export ANT_HOME=/opt/ant’添加到/etc/profile

要验证它是否有效,请运行:

To verify that it worked, run:

ant -version

这篇关于CentOS 上的 Apache Ant 1.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆