Unsupported major.minor version 51.0

Six Stars

Unsupported major.minor version 51.0

Hello,
I started using new TOS DI 6.1 in my local machine. I have JAVA 8 installed. My talend job works fine in my local.
I exported the job to a batch job, and put it in the server side. The java version in the server side is still java 7. When I ran the job, I got error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: test/main_process : Unsupported major.minor version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I tried to change the installed JRE to Java 7 under Window->Preferences->Java, and exported the job again, I got exactly the same error as above.

May I know if there is a way to let my local still using java 8 and TOS 6.1, but exported job could run under Java 7 as well.
Thanks!
Six Stars

Re: Unsupported major.minor version 51.0

Does TOS 6.1 only can work under Java 8 and cannot compile the code with lower Java JDK?
Moderator

Re: Unsupported major.minor version 51.0

Hi,

Actually, this problem is usually caused by  "a higher JDK during compile time and lower JDK during runtime". The JDK version  in your server side is java 7? Can you upgrade your JDK on server?

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Unsupported major.minor version 51.0

I was able to simply update the JDK version on the server to solve this issue. I found a tutorial how one can accomplish this.
//edit: I'm not yet allowed to post a URL but you can try this:
bigdatafan. blogspot.de / 2016 / 05 / upgrade-java-to-jdk-8-on-cloudera-cdh. html

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog