From d9575761aa1b2ad7957c6a9283eedbdd3dfb4f31 Mon Sep 17 00:00:00 2001 From: "Jesse N. Glick" Date: Wed, 24 Jan 2007 12:22:40 +0000 Subject: [PATCH] More on $CLASSPATH. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@499378 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/install.html | 73 ++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/docs/manual/install.html b/docs/manual/install.html index 2a209828d..741f744f1 100644 --- a/docs/manual/install.html +++ b/docs/manual/install.html @@ -235,39 +235,45 @@ packaged together with the core Ant tasks.

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 +libraries must be added to Ant's classpath, in any of the following ways:

@@ -277,10 +283,10 @@ libraries must be added to Ant's classpath, in any of the following ways added to a project are automatically added to ant's classpath.

-

The CLASSPATH environment variable

+

The CLASSPATH environment variable

-The CLASSPATH environment variable is a source of many Ant support queries. As +The CLASSPATH environment variable is a source of many Ant support queries. As the round trip time for diagnosis on the Ant user mailing list can be slow, and because filing bug reports complaining about 'ant.bat' not working will be rejected by the developers as WORKSFORME "this is a configuration problem, not a @@ -290,21 +296,21 @@ simple steps.

    -
  1. Do not ever set CLASSPATH. Ant does not need it, it only causes confusion +
  2. Do not ever set CLASSPATH. Ant does not need it, it only causes confusion and breaks things.
  3. If you ignore the previous rule, do not ever, ever, put quotes in the -CLASSPATH, even if there is a space in a directory. This will break Ant, and it +CLASSPATH, even if there is a space in a directory. This will break Ant, and it is not needed.
  4. If you ignore the first rule, do not ever, ever, have a trailing backslash -in a CLASSPATH, as it breaks Ant's ability to quote the string. Again, this is -not needed for the correct operation of the CLASSPATH environment variable, even +in a CLASSPATH, as it breaks Ant's ability to quote the string. Again, this is +not needed for the correct operation of the CLASSPATH environment variable, even if a DOS directory is to be added to the path.
  5. -
  6. You can stop Ant using the CLASSPATH environment variable by setting the +
  7. You can stop Ant using the CLASSPATH environment variable by setting the -noclasspath option on the command line. This is an easy way to test for classpath-related problems.
  8. @@ -312,14 +318,29 @@ to test for classpath-related problems.

    -The usual symptom of CLASSPATH problems is that ant will not run with some error -about not being able to find org.apache.tools.Ant.main, or, if you have got the +The usual symptom of CLASSPATH problems is that ant will not run with some error +about not being able to find org.apache.tools.ant.launch.Launcher, or, if you have got the quotes/backslashes wrong, some very weird Java startup error. To see if this is -the case, run ant -noclasspath or unset the CLASSPATH environment +the case, run ant -noclasspath or unset the CLASSPATH environment variable.

    +

    +You can also make your Ant script reject this environment +variable just by placing the following at the top of the script (or in an init target): +

    +
    +<property environment="env."/>
    +<property name="env.CLASSPATH" value=""/>
    +<fail message="Unset $CLASSPATH / %CLASSPATH% before running Ant!">
    +    <condition>
    +        <not>
    +            <equals arg1="${env.CLASSPATH}" arg2=""/>
    +        </not>
    +    </condition>
    +</fail>
    +

    Proxy Configuration

    @@ -836,7 +857,7 @@ your location, then dependency logic may get confused.

    If you cannot get Ant installed or working, the Ant user mailing list is the best place to start with any problem. Please do your homework first, make sure -that it is not a CLASSPATH problem, and run a CLASSPATH problem, and run a diagnostics check to see what Ant thinks of its own state. Why the user list, and not the developer list? Because there are more users than developers, so more people who can help you.