JVMCFRE003 bad major version

3527/src/ilg-sol-bridge/build.xml:268: java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=org/sonar/batch/bootstrapper/EnvironmentInformation, offset=6
3528 at java.lang.ClassLoader.defineClassImpl(Native Method)
3529 at java.lang.ClassLoader.defineClassInternal(ClassLoader.java:398)
3530 at java.lang.ClassLoader.defineClass(ClassLoader.java:359)
3531 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
3532 at java.net.URLClassLoader.defineClass(URLClassLoader.java:730)
3533 at java.net.URLClassLoader.access$400(URLClassLoader.java:96)
3534 at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1187)
3535 at java.security.AccessController.doPrivileged(AccessController.java:770)
3536 at java.net.URLClassLoader.findClass(URLClassLoader.java:605)

Hi,

Welcome to the community!

This error is telling you you’re running with the wrong version of Java. The docs should help.

 
Ann

we are required java 8 for my project .How to configure Sonarqube also use java 1.8?

Hi,

You can’t. You can either compile with Java 8 and then run analysis with the required version (you should be targeting Java 17 at this point). Or you can use Java 17 for everything and compile to a target of Java 8.

 
HTH,
Ann

property name=“sonar.java.jdk” value=“17”
property name=“sonar.java.target” value=“17”
property name=“sonar.java.source” value=“17”
can i add these three property in my build.xml sonar property section to enable sonarqube use java 17

Hi,

You need to run the job with Java 17. Those properties would tell analysis to treat your code like it’s Java 17, and by the time they’re read the Java process has already started.

 
Ann

To convert java 8 to 17 is a big deal . Any way without update java 8 to 17 to solve this error?

Hi,

I’ve already listed the options:

 
Ann

I have used Below property again same error

sonar.java.source=8
sonar.java.target=11

Hi,

You must run analysis using Java 17. The properties won’t do you any good in that regard.

Use Java 17 to run the process.

 
Ann