• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Error while executing build.xml

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

While executing build.xml i am getting following error




[javac]
[javac] D:\ABN\WSAbnjags\src\com\indussoft\Jags\Transactions\QueryModule\JTS
L_QMSessionBean.java:204: cannot resolve symbol
[javac] symbol : class LSSystemException
[javac] location: class com.indussoft.Jags.Transactions.QueryModule.JTSL_QMS
essionBean

Description

I want to create ANT script to compile java file which is located at
com\indussoft\Jags\Transactions\QueryModule folder

for that purpose i also have to extends one class name LSSystemException

Here is my ANT build.xml

<?xml version="1.0" ?>
<project name="Abn Jaguar" default="main" basedir=".">

<property name="srcDir" location="src/com/indussoft/Jags/Transactions/QueryModule"/>
<property name="distDir" location="src/com/indussoft/Jags/Transactions/QueryModule"/>
<property name="IncludeDir" location="src"/>
<property name="UtilitiesDir" location="src/com/indussoft/Jags/Utilities"/>
<property name="lib4" value="src/j2ee.jar"/>
<property name="lib5" value="src/poi-scratchpad-3.0-rc4-20070503.jar"/>
<property name="lib6" value="src/poi-contrib-3.0-rc4-20070503.jar"/>
<property name="lib7" value="src/poi-3.0-rc4-20070503.jar"/>



<target name="main" description="Compilation target">
<echo>
Compile Main Java .
</echo>

<javac srcdir="${srcDir}" destdir="${distDir}" >
<classpath>
<pathelement location="${IncludeDir}/com.indussoft.Jags.LSExceptions" />
<pathelement location="${UtilitiesDir}" />
<pathelement location="${lib4}" />
<pathelement location="${lib5}" />
<pathelement location="${lib6}" />
<pathelement location="${lib7}" />
</classpath>
</javac>
<echo>
Completed.
</echo>
</target>


</project>
 
Danish Araquei
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All ,

just want to add one more thing

in my build.xml code i try all the combination

<pathelement location="${IncludeDir}/com/indussoft/Jags/LSExceptions" />
<pathelement location="${IncludeDir}.com.indussoft.Jags.LSExceptions" />
<pathelement location="${IncludeDir}/com.indussoft.Jags.LSExceptions" />

but its not working.....

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your srcDir and distDir are incorrect. The should both be "src". (Well, actually, I disagree with placing compiled class file in the same directory as the Java source file, but that is a topic for another discussion.)
Also, this location is incorrect:

location="${IncludeDir}/com.indussoft.Jags.LSExceptions"

Though not knowing you directory structure and the exact location of the LSSystemException class, I could not offer a better gues than to change it to:

location="${IncludeDir}"

By the way, the issue here is one of not understanding how package names relate to directory names. You will probably want to review that information from a basic Java programming text. It is a key concept in being able to understand how Java applications (a misnomer if there was one) are structured.
 
Danish Araquei
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,

thanks for your reply and valuable suggestion

My Directory Structure is

com
|
|
indussoft
|
|
Jags
|
|---------------|
| |
Transactions LSExceptions
| |
| LSSystemException.class
QueryModule
|
*.class

peter i want to built ANT script for QueryModule Directory
 
Danish Araquei
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,

thanks for your reply and valuable suggestion

My Directory Structure is

com >> indussoft >> Jags >> Transactions >> QueryModule >> *.class
com >> indussoft >> Jags >> LSSystemException >> LSSystemException.class

peter i want to built ANT script for QueryModule Directory ,please suggest the valuable solution.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume that the com directory is in the src directory and that build.xml is located in the parent directory of the source directory. In other words, you have this:

some-dir/build.xml
some-dir/src/com/...

If that is true, try these changes:



All of your Java source files are in the src directory, and based the destdir setting, all class files are also in src. Therefore you do not need to include any information about those directories in the classpath - all you need are the jar files. And because you have all of your JAR files in the src directory, using a fileset to declare them is easier than using individual path element.
 
Danish Araquei
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi peter

i got the solution ...thank you very much for your support
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic