File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant error running javac compiler

 
Al Johnston
Ranch Hand
Posts: 99
Flex Java Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this has been discussed here before (several times). I implemented solutions I found in the forums to no avail. My ant file is performing as expected, up to a point. My build is failing here at line 101 of my code:



The error message I'm receiving is:



I am running ant from Eclipse with -debug on (right click on build.xml and run as ant).

I have set JAVA_HOME and PATH environment variables.

Thanks for your help!

Best,
Al
 
Max White
Ranch Hand
Posts: 85
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could you please specify the exact line numbers infront of the code you have pasted.
Thanks
 
Al Johnston
Ranch Hand
Posts: 99
Flex Java Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Max. I edited them in. Thanks for your help.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect that your source and target values are bad - try using "1.6" for both (instead of 1.6.0_16).

If that does not help, run ant with the -v option - that might give you more information.
 
Al Johnston
Ranch Hand
Posts: 99
Flex Java Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter.

I am on Vista. When I rebooted my computer, suddenly my environment variables work. I know this because now my ant build.xml error is:



I am going to change to 1.6 and try again. But, here's what strange...

If I go to my command prompt and type javac -version, the output is "javac 1.6.0_16". Yet, according to my ant build, that's not a valid version (which is a problem since it's the only version I have installed). I'm going to change to 1.6 and see if that fixes the problem. I'll update the forum following the attempt.

Thanks!

Al
 
Al Johnston
Ranch Hand
Posts: 99
Flex Java Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure enough... changing to 1.6 instead of the actual name of the version, I got a good compile. Thanks!
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[quote[If I go to my command prompt and type javac -version, the output is "javac 1.6.0_16". Yet, according to my ant build, that's not a valid version
The version of the JVM has nothing to do with the values allowed for 'source' and 'target'. For the latter, you use the specification version (or major release version) which is '1.3', 1.4', '1.5', '1.6' or '1.7'; depending on the version of javac you are using (you can't, for example, set the values to '1.7' when using a 1.6.0_16 javac).
 
Al Johnston
Ranch Hand
Posts: 99
Flex Java Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it. This was my first ever Ant compile. I really appreciate the help.

Best,
Al
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic