ARTIFACTORY: How to solve the Unsupported class file major version 61 error

ARTIFACTORY: How to solve the Unsupported class file major version 61 error

AuthorFullName__c
Lawrence Fung
articleNumber
000005429
ft:sourceType
Salesforce
FirstPublishedDate
2022-10-13T06:49:56Z
lastModifiedDate
2022-10-13
VersionNumber
2

When upgrading an Artifactory instance, you may see the following error.

java.lang.IllegalArgumentException: Unsupported class file major version 61

The Error usually indicates a mismatch between JDK version and Java class files. This might happen when upgrading to an Artifactory version above 7.43.x, since the JDK version was updated to JDK 17. 

User-added image

If you see the above error, please check your extraJavaOpts in the system.yaml for any jar files that might not be supported with JDK 17. You will need to remove it and restart Artifactory. The extraJavaOpts configuration may look similar to the following in the system.yaml.

shared: 
    ## Extra Java options to pass to the JVM. These values add to or override the defaults.
    extraJavaOpts: "-Xms512m -Xmx2g"