[JIRA] (JENKINS-58517) Unsupported major.minor version 52.0

9 views
Skip to first unread message

anestis.pontikakis@smartmatic.com (JIRA)

unread,
Jul 16, 2019, 9:21:02 AM7/16/19
to jenkinsc...@googlegroups.com
anestis pontikakis created an issue
 
Jenkins / Bug JENKINS-58517
Unsupported major.minor version 52.0
Issue Type: Bug Bug
Assignee: Unassigned
Components: dependency-check-jenkins-plugin
Created: 2019-07-16 13:20
Environment: Jenkins ver. 2.176.1, multiple JDK installation (OpenJDK 1.8.0_222-ea, Oracle JDK 1.6.0_181)
Ubuntu 14.04.6, 64bit
Dependency-Check 5.1.1 (Jenkins plugin version Version 5.0.2 (July 12, 2019))
Jenkins is running directly on AWS EC2
Jenkins slave is barebone metal with Ubuntu 14.04.6, 64bit, SSH connection
Priority: Major Major
Reporter: anestis pontikakis

While the installation works with Jenkins plugin version 4.0.2

it gives "Unsupported major.minor version 52.0" error when using the 5.0.x version.

Jenkins job is set to use the Oracle JDK, but on the slave the default JDK it OpenJDK 1.8.0.222.

 
[DependencyCheck] Exception in thread "main" java.lang.UnsupportedClassVersionError: org/owasp/dependencycheck/App : Unsupported major.minor version 52.0*14:56:46* [DependencyCheck] at java.lang.ClassLoader.defineClass1(Native Method)14:56:46 [DependencyCheck] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)14:56:46 [DependencyCheck] at java.lang.ClassLoader.defineClass(ClassLoader.java:621)14:56:46 [DependencyCheck] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)14:56:46 [DependencyCheck] at java.net.URLClassLoader.defineClass(URLClassLoader.java:304)14:56:46 [DependencyCheck] at java.net.URLClassLoader.access$000(URLClassLoader.java:56)14:56:46 [DependencyCheck] at java.net.URLClassLoader$1.run(URLClassLoader.java:218)14:56:46 [DependencyCheck] at java.security.AccessController.doPrivileged(Native Method)14:56:46 [DependencyCheck] at java.net.URLClassLoader.findClass(URLClassLoader.java:211)14:56:46 [DependencyCheck] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)14:56:46 [DependencyCheck] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)14:56:46 [DependencyCheck] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)14:56:46 [DependencyCheck] Could not find the main class: org.owasp.dependencycheck.App. Program will exit.14:56:48 Build step 'Invoke Dependency-Check' changed build result to FAILURE

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

anestis.pontikakis@smartmatic.com (JIRA)

unread,
Jul 16, 2019, 9:29:02 AM7/16/19
to jenkinsc...@googlegroups.com
anestis pontikakis updated an issue
Change By: anestis pontikakis
While the installation works with Jenkins plugin version 4.0.2

it gives "Unsupported major.minor version 52.0" error when using the 5.0.x version.

Jenkins job is set to use the Oracle JDK, but on the slave the default JDK it OpenJDK 1.8.0.222.

 

It seems the Dependency Check plugin is also using the job defined JDK ?

 
[DependencyCheck] Exception in thread "main" java.lang.UnsupportedClassVersionError: org/owasp/dependencycheck/App : Unsupported major.minor version 52.0*14:56:46* [DependencyCheck]  at java.lang.ClassLoader.defineClass1(Native Method)*14:56:46* [DependencyCheck]  at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)*14:56:46* [DependencyCheck]  at java.lang.ClassLoader.defineClass(ClassLoader.java:621)*14:56:46* [DependencyCheck]  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)*14:56:46* [DependencyCheck]  at java.net.URLClassLoader.defineClass(URLClassLoader.java:304)*14:56:46* [DependencyCheck]  at java.net.URLClassLoader.access$000(URLClassLoader.java:56)*14:56:46* [DependencyCheck]  at java.net.URLClassLoader$1.run(URLClassLoader.java:218)*14:56:46* [DependencyCheck]  at java.security.AccessController.doPrivileged(Native Method)*14:56:46* [DependencyCheck]  at java.net.URLClassLoader.findClass(URLClassLoader.java:211)*14:56:46* [DependencyCheck]  at java.lang.ClassLoader.loadClass(ClassLoader.java:306)*14:56:46* [DependencyCheck]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)*14:56:46* [DependencyCheck]  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)*14:56:46* [DependencyCheck] Could not find the main class: org.owasp.dependencycheck.App.  Program will exit.*14:56:48* Build step 'Invoke Dependency-Check' changed build result to FAILURE

steve.springett@owasp.org (JIRA)

unread,
Jul 16, 2019, 11:55:02 PM7/16/19
to jenkinsc...@googlegroups.com
Steve Springett resolved as Not A Defect
 

This is an environment issue unrelated to the Jenkins plugin. Once the Jenkins plugin makes the call to dependency-check.bat or dependency-check.sh, the resulting execution or failure to execute is not within its control.

 

In my experience, some environments with multiple versions of Java installed (especially Java 9/10/11) have this issue. It might be necessary to modify the environment or modify the dependency-check scripts themselves to specify JAVA_HOME.

Change By: Steve Springett
Status: Open Resolved
Resolution: Not A Defect

anestis.pontikakis@smartmatic.com (JIRA)

unread,
Jul 17, 2019, 3:10:02 AM7/17/19
to jenkinsc...@googlegroups.com
anestis pontikakis commented on Bug JENKINS-58517
 
Re: Unsupported major.minor version 52.0

Would it be a good solution to pass the JDK to be used as configuration parameter in the Jenkins job ?

The alternative for us is to create a separate job to just invoke the dependency-check, which create more administrative overhead of maintaining an extra job,

 

Thank you for your prompt reply!

steve.springett@owasp.org (JIRA)

unread,
Jul 17, 2019, 11:11:02 AM7/17/19
to jenkinsc...@googlegroups.com

Using the environment injector plugin and specifying JAVA_HOME does work on freestyle builds. Haven't tried on pipeline.

anestis.pontikakis@smartmatic.com (JIRA)

unread,
Jul 19, 2019, 8:37:01 AM7/19/19
to jenkinsc...@googlegroups.com

For documentation: I have injected the following  variable, which is picked up by the "dependency-check.sh" :  JAVACMD=/MyJdkDir/bin/java

This way it does not affect other build steps that require a different JDK, to facilitate legacy applications.

For future reference(New Feature) an extension of the Dependency-Check plugin to point which JDK installation to-be-used would be a plus.

A similar effort has been done in the "sonar-scanner-jenkins".

 

Thank you for the pointers Steve!

Reply all
Reply to author
Forward
0 new messages