Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant Build file HELP!!-URGENT

 
Bruno Mesta
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone??? come on guys im sure there is someone out there that can help me. As you can see im really desperate.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that people are around the world. PatienceIsAVirtue and it can take up to 24 hours for someone to see your post.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Untitled.jpg
[Thumbnail for Untitled.jpg]
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic