JRE/JVM retro compatibility

One Star

JRE/JVM retro compatibility

Hello,
I've got a little issue with JVM / JRE, version 1.5 and 1.6.
On my workstation, where I develop Talend Job, I have the JVM 1.6.0_11. I made a basic job (launch an Oracle query, and put the result into an Excel file).
I exported the JobScript (with dependencies) and give the script to a colleague of mine and ask him to lauch the job. It went to ClassVersionError.
Then he installed the JVM 1.6 (because he had the JVM 1.5) and the script ran.
Is there a way for me to generate script that can be run under the JVM 1.5 ?? Or the execution machine should have the same version of the JVM ??
Thank you for your help.
Arnaud
One Star

Re: JRE/JVM retro compatibility

Hi Arnaud,
the answer of your last question is: Yes.
You need the same (or lower) version for development than in production environment.
Bye
Volker
One Star

Re: JRE/JVM retro compatibility

Ok. That's not the expected answer, but thank you ! Smiley Happy
Is there a way to configure Talend (or Java on my computer), to define the default JVM used ?
Thanks - Arnaud
One Star

Re: JRE/JVM retro compatibility

You could set the java version in Window -> Preferences -> Talend -> java interpreter
One Star

Re: JRE/JVM retro compatibility

It is worth...
I can't even launch the job on my computer. I've got the following Error:
Exception in thread "Thread-1" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at myJob1.extract_info_0_1.Extract_Info.tOracleInput_1Process(Extract_Info.java:473)
at myJob1extract_info_0_1.Extract_Info$1.run(Extract_Info.java:837)

I've also tried to change preferences in Preferences > Java > Compiler by selecting Compiler compliance level 1.5 and JRE1.5 by default... But, idem...
Does that mean I use a component that use classes only available in the JVM 1.6 ??? The two components I have on my job are "tOracleInput" and "tFileOutputExcel"...
Arnaud
One Star

Re: JRE/JVM retro compatibility

Hi Arnaud,
version 1.5 schould be ok. You get the error on your local system?
Could you please also check the setting under Windows -> preferences -> java -> installed JRE.
Additional you could check your local environment (PATH variable, JAVA_HOME).
I'm not absolutely sure whcih function of Talend is processed by which jre / jdk - version
Hope this helps...
Bye
Volker
One Star

Re: JRE/JVM retro compatibility

Ok, I got it.... Thank you Volker !!
Here are some screen shot to explain my config (can be useful for others):
1. Added the JRE 1.5 at first position in the path variable
2. In Preferences > Talend, selected the java.exe Java interpreter
3. In Preferences > Java > Compiler, selected "Compiler compliance level: 1.5"
4. In Preferences > Java > Installed JREs, add and selected the JRE 1.5
Once done, exit and reload, and rebuild all. The generated script can then be launched on a machine where only the JVM 1.5 is present.
Thank you again Volker !!
One Star

Re: JRE/JVM retro compatibility

You are welcome!
I'm glad that I could help you.
Bye
Volker