I have a legacy webapp which uses jstl and Struts 1 tags. When I pre-compile the JSP files with Java 5/6, the jstl and Struts 1 tags throw warnings about "unchecked or unsafe operations". For example, if I use the following tag:
<%@ page import="/anotherpage.inc" %>
The following warning is thrown:
[javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details.
If I recompile with -Xlint:unchecked, I get details about the internal working of the offending JSP tag library. I would like to suppress all unchecked operation warnings. I thought that using -Xlint:-unchecked would suppress the warnings, but it did not.
How do I suppress these warnings when compiling my JSP pages? It would not be practical to re-code the JSP tag libraries or update a thousand JSP pages. I'm looking for a compiler flag to globally disable the warning so I can see all warnings except for unchecked warnings. Thanks!
You are right that
-Xlint:unchecked
does the opposite of what you want, but you can also use
-Xlint:-unchecked
Note the extra "-" in there.
This will disable all warnings about unchecked operations, not just the ones generated by the tag library, but other warnings will still be shown.