LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How do I set up Ant (https://www.linuxquestions.org/questions/slackware-14/how-do-i-set-up-ant-666908/)

JosephS 09-01-2008 01:23 PM

How do I set up Ant
 
I need help in setting up Ant

I installed apache-ant-1.7.1 to my home directory.

I'm following the directions for installing ant at:
http://ant.apache.org/manual/install.html

I added the path:
PATH=$PATH:/sbin/:/home/joe/program_downloads/ant_program/apache-ant-1.7.1/bin/
export PATH

I set the ANT_HOME environment variable:
export ANT_HOME=$/home/joe/program_downloads/ant_program/apache-ant-1.7.1/

When I ran bash-3.1$ ant I got this:
Unable to locate tools.jar. Expected to find it in /usr/lib/jre1.6.0_02/lib/tools.jar
Buildfile: build.xml does not exist!
Build failed

Quote:

The documentation says:
For the current version of Ant, you will also need a JDK installed on your
system, version 1.2 or later required, 1.5 or later strongly recommended.
The later the version of Java , the more Ant tasks you get.
Note #2: If a JDK is not present, only the JRE runtime, then many tasks will not work.

It also says in the section Setup to:
Optionally, set the JAVA_HOME environment variable (see the Advanced section below). This should be set to the directory where your JDK is in
stalled.
Where is JDK installed?

I'm unsure about setting it up for optional tasks.

Quote:

In Optional Tasks it says:
The external libraries required by each of the optional tasks is detailed in the Library
Dependencies section. These external libraries must be added to Ant's classpath, in any
of the following ways:
1. In ANT_HOME/lib. This makes the JAR files available to all Ant users and builds.
How do I add the external libraries to Ant's classpath?

Quote:

but in the section The CLASSPATH environment variable it says:
Do not ever set CLASSPATH. Ant does not need it, it only causes confusion and breaks things.
What does this mean?

Alien Bob 09-01-2008 01:34 PM

In Slackware, the JDK is not installed by default - only the JRE.
You will have to install the JDK manually, it is located in the /extra directory of the Slackware 12.1 DVD (or on CDROM #4)

After installing the JDK, logout and login again, or run
Code:

. /etc/profile
to set the right environment for your build.

Eric


All times are GMT -5. The time now is 12:00 AM.