This blog suggests a setting for tomcat, which ..." changes a series of system defaults to follow the servlet specification very strictly to ensure portability"
Deploying on Multiple Servlet Containers
While it would be ideal to standardize your entire web application stack on one servlet container, the reality is that many organizations use a variety of application servers. In the case where developers are writing the applications on Tomcat, and they may not be deployed on Tomcat, they can avoid future cross-compatibility issues by setting the system property for StrictServletCompliance. This property changes a series of system defaults to follow the servlet specification very strictly to ensure portability. For more information on configuring StrictServletCompliance
It would be handy to be do something similar to enforce compliance with the general J2SE java specifications, so that applications developed on Win/Linux/Mac, and on the various jdk flavours such as oracle and OpenJDK won't be stupidly unportable.
Does something like that exist in Java generally?
- obviously it's impossible to test arbitrary strings e.g "C://Windows/something\somtehign"
- eclipse does a lot of code linting, such as generics, and minimal compliance levels, maybe that can be applied to class files?