ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mansou...@yahoo.com
Subject Re: class path problem
Date Mon, 09 Oct 2006 15:18:54 GMT
WOW, guys thanks for the fast response, I really appretiate this help.
I am standing in the main directory (MyProject).
When I use -verbose I get alot of output, something like:

[javac] MyOp1.java added as MyOp1.class doesn't exist.
[javac] Op1Helper.java added as Op1Helper.class doesn't exist.
...... then I get:

[javac] Compilation arguments:
[javac] '-d'
[javac] '/path/to/MyProject/resulting_classes_directory'
[javac] '-classpath'
 [javac]
'/path/to/MyProject/resulting_classes_directory:/path/to/MyProject/Operation1:
/path/to/MyProject:/opt/j2sdk/lib:/path/to/MyProject/Operation1/MyOp1.java: 
......'

There nothing states that the compiler is seeing the classes in the 
package MathOp, just like I expected.
I will do a search for how to use sourcepath attribute, and try it. I 
'll let you know if it worked, in the mean while, if you have any
suggestion, please let me know.
Thank you for every body.











Scot P. Floess wrote:

> When you execute your ant script, what directory are you "standing" 
> in?  I see you give a "relative" srcdir of Operation1.  Are you 
> standing in the directory that Operation1 lives?  You may also need to 
> use sourcepath attribute.
>
> 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