• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

using -xlint with javac task

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have not used Ant in a long time.

I am attempting to run an Ant build where javac runs with the -Xlint option (seems like it should be a fairly easy thing to do).

I have not found anywhere on the web which specifically describes how to do this - only the "compilerarg" looks even remotely close - but it does not work.

If my build.xml includes this:



When I run it, I get an error:


Is this error message correct - does Ant not support -Xlint? If Ant does support -Xlint, what is the correct syntax?

Thanks,

[ July 28, 2005: Message edited by: Don Morgan ]
[ July 28, 2005: Message edited by: Don Morgan ]
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this

<compilerarg value="-Xlint"/>
 
Don Morgan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Roseanne - worked fine.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does not work

<javac compiler="${build.compiler}" srcdir="${source.delivery}" destdir="${build.delivery}" debug="on" >
<compilerarg value=" -Xlint:unchecked -Xlint eprecation" />
<classpath refid="classpath" />
</javac>

does not work

<javac compiler="${build.compiler}" srcdir="${source.delivery}" destdir="${build.delivery}" debug="on" >
<compilerarg value=" -Xlint:unchecked -Xlint eprecation" ></compilerarg>
<classpath refid="classpath" />
</javac>

and many other even sillier permutations. I have looked at the documentation and lots of web sites. What incredibly stupid thing am I doing incorrectly.
 
Ann Klein
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has Xlint quit working for newer java.

my java -version shows as "1.5.0_04"

I can use -deprecation by itself

I cannot complete my canned Ant build with out using the xlint:unchecked and it is not listed with javac -x
 
Ann Klein
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found an example at
http://weblogs.java.net/blog/dwalend/archive/2004/11/amazing_xlint.html
<javac compiler="${build.compiler}" srcdir="${source.delivery}" destdir="${build.delivery}" deprecation="yes" debug="yes">
<compilerarg value="-Xlint"/>
<classpath refid="classpath" />
</javac>

seems to have gotten past the compiler
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic