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

Getting rid of warning

 
Shweta Grewal
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
linda russel
Ranch Hand
Posts: 86
  • 1
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you doing any kind of automation?
 
linda russel
Ranch Hand
Posts: 86
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to add those annotations to your tests to ignore
 
Shweta Grewal
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to add those annotations to your tests to ignore

I am sorry still didnot get it.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a lot of them I cant change all of them.
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic