spring-cloud / spring-cloud-dataflow

A microservices-based Streaming and Batch data processing in Cloud Foundry and Kubernetes
https://dataflow.spring.io
Apache License 2.0
1.11k stars 581 forks source link

Java runtime mismatch with Springboot 3 and data flow 2.11.3 #5834

Closed shobhakamath closed 3 months ago

shobhakamath commented 3 months ago

Description: Exception in thread "main" java.lang.UnsupportedClassVersionError: org/springframework/boot/loader/JarLauncher has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0 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.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 sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Release versions: spring-cloud-dataflow-server-2.11.3.jar

Steps to reproduce: You have a springboot batch program using Springboot 3.1.8 and spring batch 5 version and java 17. Once the application is registered to the spring data flow and create a task and then launch it, this error can be reproduced.

Screenshots:

application

Additional context: The database is Oracle database.

cppwfs commented 3 months ago

This sounds like your SCDF instance is running on JVM 8 and is trying to run a Boot3/Batch5 app that is Java 17. Make sure you are running your SCDF instance on JVM 17+.

corneil commented 3 months ago

You can solve the difference by using deployer.<task>.javaHomePath.3=/path/to/java17

shobhakamath commented 3 months ago

Resolved. The issue was I was running in JRE 8 . All that I did was to run the following command sing jdk17 to make it work. Thank you for your quick response.

 path to jdk17/bin/java -jar spring-cloud-dataflow-server-2.11.3.jar