I am trying to run some code and am receiving the following error:
> Task :compileJava FAILED
/Users/sahil/Downloads/ptltrader-1.6.0/src/main/java/com/pairtradinglab/ptltrader/model/validator/MarginPercents.java:23: error: cannot access IStatus
import org.eclipse.core.runtime.IStatus;
^
bad class file: /Users/sahil/.gradle/caches/modules-2/files-2.1/org.eclipse.platform/org.eclipse.equinox.common/3.17.0/a86196c9ec6239dd479ea4a04121a5f0cf3343a8/org.eclipse.equinox.common-3.17.0.jar(org/eclipse/core/runtime/IStatus.class)
class file has wrong version 55.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
I understand that this means the code is running in Java 11 and needs to run in Java 8, but I don't know why it appears that everything is in Java 8. Any help would be appreciated.
Specs:
MacOS Big Sur v11.6.8
Java "Version 8 Update 351"
Gradle v7.6
Homebrew v3.6.16
In code:
java v1.8.0
javac v1.8.0
CodePudding user response:
It looks like the class IStatus
which you're referencing was compiled for Java 11 which is newer than your Java version (8) so the solution is to update your JDK or find a version of your library for Java 8.