• 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

Getting rid of warning

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using ant to compile a package, it gives following warning repeatedly:

warning: sun.misc.BASE64Encoder is Sun proprietary API and may be removed in a future release
[javac] BASE64Encoder encoder = new BASE64Encoder();


How can I get rid of the warning?
 
Ranch Hand
Posts: 86
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your best option would be to fix the use of deprecated APIs. However, an option would be to add the @SupressWarnings("deprecation") annotation to the classes or methods that are using the deprecated APIs.
 
Shweta Grewal
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

add the @SupressWarnings("deprecation") annotation to the classes or methods that are using the deprecated APIs.


How to do that?
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you doing any kind of automation?
 
linda russel
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you need to add those annotations to your tests to ignore
 
Shweta Grewal
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

you need to add those annotations to your tests to ignore


I am sorry still didnot get it.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Shweta Grewal wrote:

you need to add those annotations to your tests to ignore


I am sorry still didnot get it.



What is the Java file which is using this:

 
Shweta Grewal
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a lot of them I cant change all of them.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Shweta Grewal wrote:There are a lot of them I cant change all of them.



Then the only way to get rid of those warning messages is to set the nowarn attribute of Ant's javac task http://ant.apache.org/manual/Tasks/javac.html in your build file.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the way, whoever is using that sun.misc.BASE64Encoder class shouldn't be using it. I don't this those classes will be able to compile/run against anything other than Sun/Oracle JDK/JRE.

 
Shweta Grewal
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Then the only way to get rid of those warning messages is to set the nowarn attribute of Ant's javac task


Not working.I set nowarn attribute to "yes" but still there are warnings
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Shweta Grewal wrote:

Then the only way to get rid of those warning messages is to set the nowarn attribute of Ant's javac task


Not working.I set nowarn attribute to "yes" but still there are warnings



Post the relevant snippet from your build.xml which contains this change and also post the entire log output which shows this warning.
 
Shweta Grewal
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<javac srcdir="${src}" destdir="${build}/${webapp_name}/WEB-INF/classes" debug="on" encoding="iso-8859-1" nowarn="Yes">
</javac>

 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shweta, it's not going to help if you don't fully read the replies and provide relevant answers for the questions. Please read my previous post again and post what's asked for. We might have more questions later on, to see why it isn't working, this is just a start.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic