Azure pipeline & java problem

Hello

Is anyone experied message
"java.lang.UnsupportedClassVersionError: com/fortify/scancentral/launcher/Launcher 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 55.0"

2024-07-06T10:08:11.1927451Z ##[section]Starting: FortifyScanCentralSAST
2024-07-06T10:08:11.1934920Z ==============================================================================
2024-07-06T10:08:11.1935049Z Task         : Fortify ScanCentral SAST Assessment
2024-07-06T10:08:11.1935131Z Description  : Installs ScanCentral client and performs a static analysis using ScanCentral
2024-07-06T10:08:11.1935247Z Version      : 7.3.3
2024-07-06T10:08:11.1935305Z Author       : Micro Focus
2024-07-06T10:08:11.1935370Z Help         : 
2024-07-06T10:08:11.1935429Z ==============================================================================
2024-07-06T10:08:11.5890962Z ScanCentral Controller URL: https://{sast_controller}/scancentral-ctrl
2024-07-06T10:08:15.2639860Z Caching tool: scancentral 24.2.0 x64
2024-07-06T10:08:15.3172128Z Prepending PATH environment variable with directory: /opt/hostedtoolcache/scancentral/24.2.0/x64/bin
2024-07-06T10:08:15.3188086Z Working Directory: /home/vsts/work/1/s
2024-07-06T10:08:15.3273376Z [command]/opt/hostedtoolcache/scancentral/24.2.0/x64/bin/scancentral -url https://{sast_controller}/scancentral-ctrl start --upload-to-ssc --ssc-upload-token *** --application self-service-api --application-version RC --build-tool none
2024-07-06T10:08:17.3394247Z Error: LinkageError occurred while loading main class com.fortify.scancentral.launcher.Launcher
2024-07-06T10:08:17.3395285Z   java.lang.UnsupportedClassVersionError: com/fortify/scancentral/launcher/Launcher 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 55.0
2024-07-06T10:08:17.3497506Z ##[error]The process '/opt/hostedtoolcache/scancentral/24.2.0/x64/bin/scancentral' failed with exit code 1
2024-07-06T10:08:17.3547776Z ##[section]Finishing: FortifyScanCentralSAST

... on Azure pipeline after upgrade Fortify SAST enviroment form 23.2 to 24.2?

here are pipepline config:

# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
 
variables:
- group: fortify
 
trigger:
- features/48236
 
pool:
  vmImage: ubuntu-latest
 
steps:
- task: JavaToolInstaller@0
  inputs:
    versionSpec: '17'
    jdkArchitectureOption: 'x64'
    jdkSourceOption: 'PreInstalled'
- task: FortifyScanCentralSAST@7
  inputs:
    scanCentralCtrlUrl: 'https://{sast_controller}/scancentral-ctrl'
    scanCentralClientToken: '$(ScanCentral.ClientToken)'
    sscCiToken: '$(ScanCentral.SscCiToken)'
    uploadToSSC: true
    applicationName: 'self-service-api'
    applicationVersion: 'RC'
    buildTool: 'none'
YAML schema reference
Azure Pipelines YAML schema reference

I configured OpenJDK-17 (RedHat 17.0.11+9-LTS) on SSC and ScanCentral Controller. 

SSC 24.2.0.0186
ScanCentral controller 24.2.0.0050
workers: 24.2.0.0150

Thank You in advance

-- 
Pawel


edit:

It looks like azure uses jre11 or earlier, but I'm not sure how to force using jre-17? 
Localy SSC, controller and two workers works fine with no errors.  

Parents
  • 0

    The pipeline error message looks the same  despite using different versions of JRE:  

    #1
    without JavaToolInstaller@0
     
    /usr/lib/jvm/temurin-11-jdk-amd64
     
    Error: LinkageError occurred while loading main class com.fortify.scancentral.launcher.Launcher
    	java.lang.UnsupportedClassVersionError: com/fortify/scancentral/launcher/Launcher 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 55.0
    ##[error]The process '/opt/hostedtoolcache/scancentral/24.2.0/x64/bin/scancentral' failed with exit code 1
     
     
    #2
    with JavaToolInstaller@0 SET to 17
    BEFORE /usr/lib/jvm/temurin-11-jdk-amd64
    AFTER /usr/lib/jvm/temurin-17-jdk-amd64
     
    Error: LinkageError occurred while loading main class com.fortify.scancentral.launcher.Launcher
    	java.lang.UnsupportedClassVersionError: com/fortify/scancentral/launcher/Launcher 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 55.0
    ##[error]The process '/opt/hostedtoolcache/scancentral/24.2.0/x64/bin/scancentral' failed with exit code 1
     
     
    #3
    with JavaToolInstaller@0 SET to 8
    BEFORE /usr/lib/jvm/temurin-11-jdk-amd64
    AFTER /usr/lib/jvm/temurin-8-jdk-amd64
     
    Error: LinkageError occurred while loading main class com.fortify.scancentral.launcher.Launcher
    	java.lang.UnsupportedClassVersionError: com/fortify/scancentral/launcher/Launcher 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 55.0
    ##[error]The process '/opt/hostedtoolcache/scancentral/24.2.0/x64/bin/scancentral' failed with exit code 1

    Does this mean that the controller serves a client with version jre11 built-in, or does the controller itself have this version entered in the configuration?

    The same error occurs for Azure pipeline VM image in macOS, Ubuntu and Win versions.

  • 0 in reply to 

    I have this same Issue but in Fortify On Demand integrated with Azure Devops. 

    Anyone coul resolve this? I don know how to force JAVA_HOME to JAVA_HOME_17_X64 on Scancentral client on Azure Devops. 

    Thank you all in advance. 

    CyberSecurity Practitioner and Cloud Enthusiast

  • 0 in reply to 

    Hello

    Please place some configs, screens, logs to describe your problem.

    best regards 

    -- 
    Pawel 

Reply Children
No Data