I am using Jetty in my java project. I am using gradle to build and OpenJDK 1.8.
Recently my build broke, and I determined that if I rolled back the Jetty version is was fixed. It seems like the new version of Jetty jar was built with a different version of Java (I am just guessing here).
Here is my build.gradle...
apply plugin: 'java'
// Use maven repository
repositories {
mavenCentral()
}
dependencies {
implementation 'org.eclipse.jetty:jetty-servlet:+'
implementation 'org.eclipse.jetty:jetty-client:+'
}
Here is the build error...
/home/me/src/Chess/src/main/java/Client.java:1: error: cannot access HttpClient import org.eclipse.jetty.client.HttpClient; ^ bad class file: /home/me/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-client/10.0.0-alpha0/81ce90a421540f2c7e4e3026702dde608fc95c83/jetty-client-10.0.0-alpha0.jar(org/eclipse/jetty/client/HttpClient.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.
When I changed my gradle.build to use the previous version of Jetty, the build compiles properly...
dependencies {
implementation 'org.eclipse.jetty:jetty-servlet:9.4.18.v20190429'
implementation 'org.eclipse.jetty:jetty-client:9.4.18.v20190429'
}
How can I use the latest version of Jetty without my build breaking? Do I have to upgrade my Java version? That doesn't seem like a good solution...