Eclipse Tycho, a Maven plugin for building Eclipse plugins, raises a compile error that Eclipse IDE does not: Cannot refer to a non-final variable urlString inside an inner class defined in a different method
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.19.0:compile (default-compile) on project org.nodeclipse.ui: Compilation failure: Compilation failure:
[ERROR] D:\Workspaces\Nodeclipse-DEV\nodeclipse-1\org.nodeclipse.ui\src\org\nodeclipse\ui\preferences\NodePreferencePage.java:[93]
[ERROR] URL url = new URL(urlString);
[ERROR] ^^^^^^^^^
[ERROR] Cannot refer to a non-final variable urlString inside an inner class defined in a different method
[ERROR] 1 problem (1 error)
The fix is trivial, simply add a final
.
However I was wondering why the compilation with Tycho is different from Eclipse IDE? Both have Java version set to 1.6 (see in pom.xml)
Details on the project setup:
- .project and .classpath are committed
- .classpath has JavaSE-1.6 and I can see that in Eclipse as "JRE System Library [JavaSe-1.6]" folder.
-
META-INF/MANIFEST.MF
declares
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
However I did run over JVM 8 and I had workspace default to 1.8