This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

warning messaged during compile

 
william kane
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two queries
1.Is it possible to set debug levels for warning displayed during compilation?
2.Will there be any warning messages displayed during compilation other than messages for use of deprecated api?
Thanks in advance
 
Kripal Singh
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have a look at tools doc . talking about j2se 5.0

http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html

here are some options

user the option
-nowarn
Disable warning messages. This has the same meaning as -Xlint:none.

deprecation
Show a description of each use or override of a deprecated member or class. Without -deprecation, javac shows the names of source files that use or override deprecated members or classes. -deprecation is shorthand for -Xlint eprecation.

see other Non-Standard Options
 
william kane
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kripal Singh:
have a look at tools doc . talking about j2se 5.0

http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html

here are some options

user the option
-nowarn
Disable warning messages. This has the same meaning as -Xlint:none.

deprecation
Show a description of each use or override of a deprecated member or class. Without -deprecation, javac shows the names of source files that use or override deprecated members or classes. -deprecation is shorthand for -Xlint eprecation.

see other Non-Standard Options


Thanks kripal for that clarification.
To futher my query,In my experience with java ,the compiler only displays warning messages to show that depricated api has been used. Are there any other warning messaged displayed during compile.
If yes,can i set debug levels and choose to view some and supress some.
Thanks in Advance
William
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the Java compiler itself I don't believe you can do that. However, many Java IDEs like Eclipse do support customizization of warning reporting.
 
Scott Dunbar
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've gotten things like:



or if you are compiling without using the -source when I have a method named assert().

Either way, I'd really encourage you to pay attention to the warnings. Every once in a while they are harmless but they almost always are something to pay attention to.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic