Search code examples
javascalaapache-sparkgithub-actionscicd

Unit Tests in GHA failing with java.lang.IllegalArgumentException: Unsupported class file major version 55


I've inherited a codebase that hasn't been touched for around 3 years. I've noticed that a large number of unit tests in our GitHub action for the repo are failing with the error:

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

A quick google suggested that I needed to update to Java 11, so I added the following step to our main.yml:

- name: Set up Java
  uses: actions/setup-java@v3
  with:
    distribution: 'zulu'
    java-version: '11'

But the tests are still failing with the same error.

Can anyone lend a hand with this?


Solution

  • Or vice versa this can mean that you need to downgrade to Java less than 11 because one of dependencies doesn't work with Java 11


    Spark Error - Unsupported class file major version

    IllegalArgumentException: 'Unsupported class file major version 55'

    Spark: IllegalArgumentException: 'Unsupported class file major version 55'

    How can I fix "unsupported class file major version 60" in IntelliJ IDEA?

    How to fix 'Unsupported class file major version 55' while executing 'org.apache.spark.sql.DataSet.collectAsList()'