Re: Javac Run By Ant Script is Unable to Find External Jars

Dennis Putnam <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
I apologize for being a pest but this is a problem I cannot resolve on
my own. The more I read the more confusing it gets. It seems like there
are thousands of ways to accomplish what I want but none make any more
sense than what I have. Is there no one that can help me debug this
problem or at least point me in the right direction?

On 2/14/2019 9:42 AM, Dennis Putnam wrote:
> Hi Jaikiran,
>
> Thanks for the reply. I thought the classpath parameter defaulted to
> "basedir"/.classpath. In any case I made the following change:
>
> <javac srcdir="src" destdir="bin" includeantruntime="false" classpath=".classpath" />
>
> Unfortunately that didn't help. The ant output is exactly the same.
> FWIW here is .classpath:
>
>     <?xml version="1.0" encoding="UTF-8"?>
>     <classpath>
>             <classpathentry including="**/*.java" kind="src"
>     output="target/classes" path="src">
>                     <attributes>
>                             <attribute name="optional" value="true"/>
>                             <attribute name="maven.pomderived"
>     value="true"/>
>                     </attributes>
>             </classpathentry>
>             <classpathentry kind="con"
>     path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
>                     <attributes>
>                             <attribute name="maven.pomderived"
>     value="true"/>
>                     </attributes>
>             </classpathentry>
>             <classpathentry kind="lib"
>     path="/lib/java-ext/json-simple-1.1.1/json-simple-1.1.1.jar"/>
>             <classpathentry kind="con"
>     path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
>                     <attributes>
>                             <attribute name="maven.pomderived"
>     value="true"/>
>                     </attributes>
>             </classpathentry>
>             <classpathentry kind="output" path="target/classes"/>
>
> The "lib" path is correct. I am guessing that the next tag essentially
> points the pom.xml so here it is in case it matters:
>
>     <project xmlns="http://maven.apache.org/POM/4.0.0"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>     http://maven.apache.org/xsd/maven-4.0.0.xsd">
>       <modelVersion>4.0.0</modelVersion>
>       <groupId>KCBSEvents</groupId>
>       <artifactId>KCBSEvents</artifactId>
>       <version>0.0.1-SNAPSHOT</version>
>       <build>
>         <sourceDirectory>src</sourceDirectory>
>         <resources>
>           <resource>
>             <directory>src</directory>
>             <excludes>
>               <exclude>**/*.java</exclude>
>             </excludes>
>           </resource>
>         </resources>
>         <plugins>
>           <plugin>
>             <artifactId>maven-compiler-plugin</artifactId>
>             <version>3.7.0</version>
>             <configuration>
>               <source>1.7</source>
>               <target>1.7</target>
>             </configuration>
>           </plugin>
>         </plugins>
>       </build>
>        <dependencies>
>             <dependency>
>                     <groupId>org.apache.httpcomponents</groupId>
>                     <artifactId>httpclient</artifactId>
>                     <version>4.5.6</version>
>             </dependency>
>             <dependency>
>                     <groupId>commons-io</groupId>
>                     <artifactId>commons-io</artifactId>
>                     <version>2.5</version>
>             </dependency>
>             <dependency>
>                     <groupId>org.apache.httpcomponents</groupId>
>                     <artifactId>httpcore</artifactId>
>                     <version>4.4.10</version>
>             </dependency>
>             <dependency>
>                     <groupId>commons-codec</groupId>
>                     <artifactId>commons-codec</artifactId>
>                     <version>1.10</version>
>             </dependency>
>             <dependency>
>                     <groupId>commons-logging</groupId>
>                     <artifactId>commons-logging</artifactId>
>                     <version>1.2</version>
>             </dependency>
>        </dependencies>
>
> Presumably the maven libraries are found from the zipfilesets in the
> ant script.
>
> On 2/14/2019 8:55 AM, Jaikiran Pai wrote:
>> Hi Dennis,
>>
>> On 13/02/19 11:56 PM, Dennis Putnam wrote:
>>> <javac srcdir="src" destdir="bin" includeantruntime="false" />
>> I don't see any classpath being passed to the javac task in your build
>> script. You should be passing a classpath containing your jars that are
>> required to compile the source. There's more than one way to do that.
>> The javac task manual has more details about it
>> https://ant.apache.org/manual/Tasks/javac.html
>>
>>
>> -Jaikiran
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
signature.asc (application/pgp-signature, 196 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)

iEYEARECAAYFAlxpd3oACgkQ/fiWYqZ2tVTJpACffJjQ4A4Dtw+zNuJrxIVkVwXM
tpsAoN73l0neS9KUsaax8GV+fKXyQCvo
=sCys
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.