I have a question regarding a Blackduck scan. It only runs until the signature scan and then exits with the exit code 1 & throws the following error:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/blackducksoftware/scan/cli/wrapper/ScanCliWrapper has been compiled by a more recent version of the Java Runtime (class file version 55.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)
The signature scanner memory is set to 256 and I am using JRE8 which is declared in the java_home and path variables (.bin in jre folder) as well.
This is the code to execute the scan:
C:\Program Files (x86)\Java\jre8\bin\java" -jar "$dir_path/synopsys-detect-7.14.0.jar" --detect.project.name=<Project-Name> --detect.project.version.name=test_version --blackduck.trust.cert=true --logging.level.com.synopsys.integration=DEBUG --detect.cleanup=false --detect.blackduck.signature.scanner.memory=256 -de #--detect.detector.search.depth=3
Does anyone have an idea on how I can solve this? Is jre8 wrong? Or is something wrong with the scanner memory?
I'd appreciate your help :)
According to the table in Java class file on Wikipedia, version 55 corresponds to Java 11:
Java SE 18 = 62 (0x3E hex),
Java SE 17 = 61 (0x3D hex),
Java SE 16 = 60 (0x3C hex),
Java SE 15 = 59 (0x3B hex),
Java SE 14 = 58 (0x3A hex),
Java SE 13 = 57 (0x39 hex),
Java SE 12 = 56 (0x38 hex),
Java SE 11 = 55 (0x37 hex),
Java SE 10 = 54 (0x36 hex),
Java SE 9 = 53 (0x35 hex),
Java SE 8 = 52 (0x34 hex),
Java SE 7 = 51 (0x33 hex),
Java SE 6.0 = 50 (0x32 hex),
Java SE 5.0 = 49 (0x31 hex),
JDK 1.4 = 48 (0x30 hex),
JDK 1.3 = 47 (0x2F hex),
JDK 1.2 = 46 (0x2E hex),
JDK 1.1 = 45 (0x2D hex).
It seems that this scanner needs to be run with Java 11 or later.