ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashant <prash...@pramati.com>
Subject Re: class path problem
Date Mon, 09 Oct 2006 14:42:33 GMT
Use switch -verbose when running your ant target. This will spit out the 
'javac' command ANT is using.

Eg: ant op1 -verbose

Examine how this command is different from the 'javac' command that 
works for you.

Hope this helps.
-Prashant

mansour77@yahoo.com wrote:
> Hi Every Body:
> I am facing a probelm compile a java application. My Java application 
> uses external and internal  library.
> In other words, let's say i have a package called  java.matrix, and I  
> wrote a package for this project called MathOp,
>
> the layout of my project directory is :
>    MyProject
>                MathOp
>                       Addition.java
>                       Multiplication.java
>                       Subtraction.java
>                       Division.java
>                Operation1
>                       some classes
>                Operation2
>                       more classes
>                build.xml
>                resulting_classes_directory               
>                MANIFEST.1
>
> Now I need to be able to include all or the needed classes from MathOp 
> into the compilation of Operation1, and put the results in 
> resulting_classes_directory.  I can do this from the command promt 
> using option of javac and it works fine  for exmaple I can do :
> javac -classpath /opt/j2sdk/lib/:/path/to/my/project:Operation1  -d 
> resulting_classes_directory/     Operation1/*.java
> When I try to do this with ant, it fails complaining about not finding 
> the classes in the package MathOp. I dont want to compile the whole
> package of MathOp. Please don't suggest this. I want it to be compiled 
> when the classes that needs it is compiled. Here's what I have in my 
> build.xml file.
>
> <target name="op1"    description="Compiles the Operation 1 and 
> package it">
>        <javac     srcdir="Operation1" 
> destdir="resulting_classes_directory" includes="**/*.java" >
>            <classpath>
>                <pathelement path="Operation1"/>
>                <pathelement path="."/>
>                <pathelement path="/path/to/my/project"/>
>                <pathelement path="/opt/j2sdk/lib/" />                  
> <fileset dir="Operation1">
>                      <include name="**/*.java"/>
>                </fileset>
>            </classpath>
>        </javac>
>        <jar destfile="Op1.jar" basedir="resulting_classes_directory" 
> manifest="MANIFEST.1" />
>    </target>
>
> none of the classes are compiled, "And It Is Important That They Are 
> Compiled Only When Ant Is Invoked."
> Please let me know what I am missing here, or at least what to search 
> for in google.
> Thank you in advance.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message