aspose file tools*
The moose likes Beginning Java and the fly likes Xlint Compiler Warnings from the Command-Line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Xlint Compiler Warnings from the Command-Line" Watch "Xlint Compiler Warnings from the Command-Line" New topic
Author

Xlint Compiler Warnings from the Command-Line

Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

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

Joined: Mar 28, 2008
Posts: 54
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.


Dale Carnegie:<br />"Most of the important things in the world have been accomplished<br />by people who have kept on trying when there seemed to be no hope at all."
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

-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"


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Xlint Compiler Warnings from the Command-Line