• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Xlint Compiler Warnings from the Command-Line

 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you turn on Java 5.0 compiler warnings from the command-line.

I want to turn on warnings for 'unused' and 'unchecked' generics and maybe more.
 
Stuart Smith
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you can, you can do it in Netbeans javac -help did not reveal the -xint option but there might be a few options there you could use for example -deprecation, it might be that is uses the -xint behaviour by default as there is a -nowarn option.
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
-Xlint:unchecked

After the : the following are allowed (in JDK 6):
all
cast
deprecation
divzero
empty
unchecked
fallthrough
path
serial
finally
overrides
-cast
-deprecation
-divzero
-empty
-unchecked
-fallthrough
-path
-serial
-finally
-overrides
none

You can see this for yourself by just typing "javac -X"
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.

I wanted to use 'unused' too. The warning is available in Eclipse and it seems to point me right to where the bugs are. I can use Eclipse, but there are students, using BlueJ, who I thought could get the 'unused' warning.

Is there is an IDE somewhere between the complexity of BlueJ and Eclipse that will give students the warnings that they need (such as 'unused'), but not have such a learning curve as Eclipse.

Perhaps JCreator?

Maybe this thread should be moved to the forum on IDEs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic