we're currently trying to upgrade our software solution to Java 8 from previously Java 6. We've already succeeded in getting everything to run and build on our development machines, but are now stuck on our build server being unable to build certain parts with PDE.
We have tried to change multiple settings within the build.properties file, the manifests of the corresponding features, but to no avail. I have also verified, that the rt.jar is a java 8 version of the file.
The error we're getting is:
Syntax error, annotations are only available if source level is 1.5 or greater
In our manifest for the particular bundle generating the problem we have set:
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Within the build properties file for the build script we have set:
bootClasspath=${java.home}/lib/rt.jar
JavaSE-1.8= ${java.home}/lib/rt.jar
path.jre = ${java.home}
javacSource=1.8
JavacTarget=1.8
Additionally we have set a specific Java 1.8 Compiler in the Eclipse settings for the project instead of the workspace default.
Also at the end of the build I'm getting:
BUILD FAILED
/QuickBuild/quickbuild-5.0.10/workspace/Eclipse-Builds/Client/buildscripts/buildRCP.xml:20: Java returned: 13
I couldn't find a definite answer what exactly causes the return 13. Apparently it can be a mismatch of 64 Bit eclipse and a 32 bit JDK, but maybe also just a compatability error with Java 1.8. After setting my compiler to verbose from the Ant script calling it, I was able to find the lines
12:47:37,579 INFO - [java] Override ignored for property "javacSource"
12:47:37,579 INFO - [java] Override ignored for property "javacTarget"
Apparently the compiler ignores the settings for the build and falls back (or uses a previously somewhere set version) on a java version below 1.5 to compile the code. I can't seem to find out if it is a setting I'm still missing, or I made any mistakes within our build.properties file. The log does not seem to generate any errors for false inputs within the properties file. Is there any way to verify that the settings I have set within the property file are actually used, or am I missing a setting?
I've figured out, that most of those settings were not actually used, since the actual script called by PDE just called the JDT compiler with the source level specified in the jdt.core.prefs file of the eclipse project. Since the eclipse version on our build server does not support Java 8 yet, it couldn't figure out how to compile Java 8 code, and somehow must have reverted back to a source level below 1.5 for compilation. I'll have to look up how to replace the JDT compiler with a newer version in this case.