How do you configure the IDEs to give the warning message given by javac's -Xlint option?
D:\Java\jdk1.6.0_29\bin\javac.exe -Xlint TestCode12.java TestCode12.java:116: warning: [empty] empty statement after if if(true); ^ 1 warning
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
How do you configure the IDEs to give the warning message given by javac's -Xlint option?
D:\Java\jdk1.6.0_29\bin\javac.exe -Xlint TestCode12.java TestCode12.java:116: warning: [empty] empty statement after if if(true); ^ 1 warning
For which IDE?
In Eclipse, if you go to Preferences > Java > Compiler > Errors/Warnings you can change the behavior for various compiler hints.
I'm unfamiliar with what the -Xlint flag does and I can't find any documentation for it, but Eclipse has a setting for empty statements (under Potential Programming Problems).
From the javac doc:
I get code from OPs using Netbeans with this problem. What do they need to do to get a warning from their IDE?Non-Standard Options
-Xbootclasspath/p:path
Prepend to the bootstrap class path.
-Xbootclasspath/a:path
Append to the bootstrap class path.
-Xbootclasspath/:path
Override location of bootstrap class files.
-Xlint
Enable all recommended warnings. In this release, all available warnings are recommended.
If you don't understand my answer, don't ignore it, ask a question.
I'm not a Netbeans user so I don't know how much help I can be, but I did find this question over at StackOverflow which might be promising.