• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Ant error running javac compiler

 
Ranch Hand
Posts: 99
Postgres Database Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Postgres Database Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Max. I edited them in. Thanks for your help.
 
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 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
Postgres Database Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Postgres Database Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
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
[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
Postgres Database Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got it. This was my first ever Ant compile. I really appreciate the help.

Best,
Al
 
Goodbye moon men. Hello tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic