The ant-launcher creates its own classpath, after that you have multiple 
ant.jar (the correct one and the one from CLASSPATH). Maybe that´s why.

Jan

>-----Ursprüngliche Nachricht-----
>Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
>Gesendet: Freitag, 17. Februar 2006 17:56
>An: user@ant.apache.org
>Betreff: RE: ant-contrib requires ant.jar but including it breaks javac
>
>
>By copying ant-contrib.jar to ANT_HOME and removing it (and 
>ant.jar) from classpath the problem went away. Thanks for the 
>suggestion.
>
>Any idea why having it the other way causes a problem though?
>
>Thanks,
>Mehdi
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Friday, February 17, 2006 11:39 AM
>To: user@ant.apache.org
>Subject: AW: ant-contrib requires ant.jar but including it breaks javac
>
>Just put the ant-contrib in one of the external library 
>directories, e.g. USER_HOME/.ant/lib.
>
>Jan 
>
>>-----Ursprüngliche Nachricht-----
>>Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>>Gesendet: Freitag, 17. Februar 2006 17:36
>>An: user@ant.apache.org
>>Betreff: ant-contrib requires ant.jar but including it breaks javac
>>
>> 
>>
>> 
>>
>>I started using foreach from ant-contrib. It seems to require ant.jar 
>>to be in classpath. However, when I put it in the classpath, 
>ant cannot 
>>compile any java code (I can manually compile of course and it works 
>>fine, removing foreach and compiling java code through ant works fine 
>>also).
>>
>> 
>>
>>CLASSPATH=.;c:\Tools\apache-ant-1.6.5/lib/ant-launcher.jar;c:\T
>>ools\ant-
>>contrib/lib/ant-contrib.jar;c:\Tools\apache-ant-1.6.5/lib/ant.jar
>>
>>PATH=C:\Tools\j2sdk1.4.2_09/bin;c:\Tools\apache-ant-1.6.5/bin;
>>
>>Apache Ant version 1.6.5 compiled on June 2 2005
>>
>>Buildfile: build.xml
>>
>>Detected Java version: 1.4 in: C:\Tools\j2sdk1.4.2_09\jre
>>
>>Detected OS: Windows XP
>>
>> 
>>
>>Ant startup:
>>
>> 
>>
>>%JAVA_HOME%/bin/java -classpath %CLASSPATH% -Dant.home=%ANT_HOME% 
>>org.apache.tools.ant.launch.Launcher
>>-verbose -buildfile %BUILD_FILE% %1
>>%2 %3 %4
>>
>> 
>>
>>build.xml:
>>
>> 
>>
>>   <taskdef resource="net/sf/antcontrib/antlib.xml" />
>>
>> 
>>
>>Exception with ant.jar in the classpath:
>>
>> 
>>
>>build.xml:162: Unable to find a javac compiler; 
>>com.sun.tools.javac.Main is not on the classpath.
>>
>>Perhaps JAVA_HOME does not point to the JDK at 
>>org.apache.tools.ant.ProjectHelper.addLocationToBuildException(
>>ProjectHe
>>lper.java:539) at
>>org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstan
>>ce.java:3
>>80)
>>
>> 
>>
>>Exception without ant.jar in classpath:
>>
>> 
>>
>>build.xml:67: The following error occurred while executing this line:
>>
>>jar:file:/C:/Tools/ant-contrib/lib/ant-contrib.jar!/net/sf/antc
>>ontrib/an
>>tlib.xml:3: taskdef A class needed by class 
>>net.sf.antcontrib.platform.ShellScriptTask cannot be found:
>>org/apache/tools/ant/taskdefs/ExecTask at 
>>org.apache.tools.ant.ProjectHelper.addLocationToBuildException(
>>ProjectHe
>>lper.java:539)
>>
>> 
>>
>>I have a feeling that there is another jar file(s) that I am missing.
>>Any ideas?
>>
>> 
>>
>>Thanks,
>>
>>Mehdi Rakhshani
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED] For 
>additional commands, e-mail: [EMAIL PROTECTED]
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED] For 
>additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to