Buildtoolkit/Build version for RTC Server 5.0.2 with JAVA_HOME=JDK1.5
Which version of Buildtoolkit/Build is suitable for RTC Server 5.0.2 with JAVA_HOME=JDK1.5 (mandatory for application build)?
Currently i have :
OS: Linux
build engine 5.2 running with IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64 jvmxa6460sr16-20140626_204542 (JIT enabled, AOT enabled)
Apache Ant(TM) version 1.9.7
if in build definition i set JAVA_HOME=PATH_FOR_JDK1.5 i get -->
BUILD FAILED
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:88)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:278)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:185)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:107)
at org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:122)
at org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:106)
at org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:174)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:245)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:178)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
at org.apache.tools.ant.Main.runBuild(Main.java:829)
at org.apache.tools.ant.Main.startAnt(Main.java:236)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
Thanks for your support.
Giorgio
Currently i have :
OS: Linux
build engine 5.2 running with IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64 jvmxa6460sr16-20140626_204542 (JIT enabled, AOT enabled)
Apache Ant(TM) version 1.9.7
if in build definition i set JAVA_HOME=PATH_FOR_JDK1.5 i get -->
BUILD FAILED
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:88)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:278)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:185)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:107)
at org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:122)
at org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:106)
at org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:174)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:245)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:178)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93)
at org.apache.tools.ant.Main.runBuild(Main.java:829)
at org.apache.tools.ant.Main.startAnt(Main.java:236)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
Thanks for your support.
Giorgio
Accepted answer
If I understand the issue correctly, that is, you have set the "Java home" under the Ant Configuration in the build definition, then it is what you get (the exceptions are thrown by Ant). Effectively, you ask Ant to run with JDK 1.5, which it fails due to mismatched class version. I believe the supplied Ant libraries are built with Java 6 and you have to run it with Java 6 or newer. So, you cannot do it that way.
Instead, to build your source with JDK 1.5, you should invoke the correct compiler (javac) in the build script. To avoid confusion, you may consider using command line rather than Ant for the build.
Instead, to build your source with JDK 1.5, you should invoke the correct compiler (javac) in the build script. To avoid confusion, you may consider using command line rather than Ant for the build.
Comments
One other answer
Please read this post: The Day The JBE Stood Still and use the JDK that ships with the version of RTC you use to run the JBE. Note the build process itself can use a different JDK as far as I can tell.