How do I treat warnings as errors with the Eclipse Java compiler (ECJ) 3.6.2 * when running from the command-line ?
Newer versions (at least, 3.8.2) have the -err:all
flag, however this isn't available in 3.6.2. Do I have any other options?
I've found this question ( Javac: Treat warnings as errors ) which recommends the undocumented -Werror
flag, but that only seems to work for javac.
Note: For various reasons completely out of my control, I must use ECJ 3.6.2. So switching to a newer version or javac is not an option (at least, not in the immediate future)!
I don't think there's a way to specify err:all, but there's a decent workaround:
Here's an example using ant:
<javac srcdir="${test-unit.dir}" destdir="${target-test-classes.dir}"
classpathref="test.classpath" source="1.6" target="1.6" debug="true"
includeAntRuntime="false" compiler="org.eclipse.jdt.core.JDTCompilerAdapter">
<compilerclasspath location="./libs/ecj-3.7.2.jar" />
<compilerarg line="-time -properties .settings/org.eclipse.jdt.core.prefs" />
</javac>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.