File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant Build file HELP!!-URGENT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant Build file HELP!!-URGENT" Watch "Ant Build file HELP!!-URGENT" New topic
Author

Ant Build file HELP!!-URGENT

Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
Hello,

Im a newbie at using the ant tool. I been doing lots of reading but im a lil confused. My build.xml is the following:



but whenever i try to run it i get the following error:

Buildfile: C:\Users\bmesta\Desktop\workspace\Project2\build.xml
compile-test:
[javac] Compiling 3 source files
[javac] C:\Users\bmesta\Desktop\workspace\Project2\test\project2\GSTCalcFrameTest.java:59: cannot find symbol
[javac] symbol : class GSTCalcFrame
[javac] location: class project2.GSTCalcFrameTest
[javac] GSTCalcFrame aFrame = new GSTCalcFrame("GST Calculator",new GSTCalcPanel());
......
......
[javac] 90 errors

BUILD FAILED
C:\Users\bmesta\Desktop\workspace\Project2\build.xml:14: Compile failed; see the compiler error output for details.

Total time: 1 second

I don't know how to fix this and its getting me frustrated. If someone can help me fix this problem it will be greatly appreciate it.







Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
anyone??? come on guys im sure there is someone out there that can help me. As you can see im really desperate.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Note that people are around the world. PatienceIsAVirtue and it can take up to 24 hours for someone to see your post.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Oh and welcome to JavaRanch!

Now on to your question. The compiler error indicates compile-test can't find the main code. That compiles uses a classpath of classpath.test. Which has classpath.base in the classpath which is blank. So which line of code do you think includes the GSTCalcFrame class?
Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
Jeanne Boyarsky thanks for you help. to tell you the truth i didn't write the build.xml from scratch I kind of copy from a tutorial and did some modifications according to my need. I knew the problem was in the target compile test. I just don't know what should i put in it. especially in the parameter srcdir and in refid? i tried putting the location of my javac.exe in the srcdir and leaving the refid the same but i got an error. In the image i attached you can see my folder structure. I dont really know why they define their path id to be classpath.base and their classpath ref id to be classpath.test. Are these packages?


[Thumbnail for Untitled.jpg]

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I think you'd have a little better luck if you took a step back, as opposed to putting random things in attributes (like the Java compiler path into an attribute meant to indicate the Java source directory).

As Jeanne said, you don't reference your non-test code (package) in your build file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant Build file HELP!!-URGENT