Hadoop-Common 3.4.1 Неподдерживаемый файл класса основная версия 65 ОшибкаJAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Hadoop-Common 3.4.1 Неподдерживаемый файл класса основная версия 65 Ошибка

Сообщение Anonymous »

У меня есть проект Gradle, и я использовал Hadoop-Common 3.3.6, но хочу обновить до 3.4.1. Когда я это сделал, я получил ошибку ниже: < /p>

Код: Выделить всё

> Task :sparkRuntimeJar FAILED
ex
java.lang.IllegalArgumentException: Unsupported class file major version 65
at org.objectweb.asm.ClassReader.(ClassReader.java:199)
at org.objectweb.asm.ClassReader.(ClassReader.java:180)
at org.objectweb.asm.ClassReader.(ClassReader.java:166)
at org.objectweb.asm.ClassReader.(ClassReader.java:287)
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
at com.github.jengelman.gradle.plugins.shadow.tasks.ShadowCopyAction$StreamAction.remapClass(ShadowCopyAction.groovy:339)
< /code>
Я изначально использовал Java 17, но я изменил свою достоверность и TargetCompatibility на 21 Я также использую Java 21 в своей раковине с SDKMAN, и я имею Gradle 8.14 < /p>
openjdk 21.0.7 2025-04-15 LTS
OpenJDK Runtime Environment Microsoft-11369939 (build 21.0.7+6-LTS)
OpenJDK 64-Bit Server VM Microsoft-11369939 (build 21.0.7+6-LTS, mixed mode, sharing)
< /code>
Но я все еще получаю такую ​​же ошибку, что и ниже, я все еще новичок в Градле, поэтому я могу упустить что -то очевидное. Любое руководство будет высоко оценено! < /P>
Это мой файл build.gradle < /p>
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id 'java'
id 'distribution'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.jfrog.artifactory' version "4.33.1"
id "com.hcl.security.appscan" version "1.0.4"
id 'com.github.spotbugs' version '5.1.2'
id "nebula.lint" version "17.8.0"
}

sourceCompatibility = 21.0
targetCompatibility = 21.0

version = project.hasProperty('buildNumber') ?
baseVersion + '.' + buildNumber : baseVersion + '.dev'
group = 'analytics.core'

allprojects {
apply {
plugin 'java'
plugin 'com.github.johnrengelman.shadow'
plugin 'jacoco'
plugin 'maven-publish'
plugin 'com.github.spotbugs'
gradleLint.rules = ['unused-dependency'] // Set to 'all-dependency' to lint everything
}

repositories {
if (!project.hasProperty('buildNumber')) {
// If we have a build number (CI build), we disable this as the artifactory
// plugin will configure the correct repos
maven {
name 'release'
url 'repo here'
credentials {
username = "username"
password = "password"
}
}
}

println 'Configured repositories:'
project.repositories.each { println it.hasProperty('url') ? it.url : '--local--' }
}
configurations {
// Prevent duplicate java.utils import at compileTime.  Imported as runtime dependency only
implementation.exclude group: 'com.boundary', module: 'high-scale-lib'
api.exclude group: 'com.boundary', module: 'high-scale-lib'
}
/*
* NOTE: These dependencies are top-level.
*       Do not set subproject dependencies here.
*/
dependencies {
implementation group: 'org.apache.kerby', name: 'kerb-admin', version: '2.0.3'
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '4.28.2'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.20.0'
implementation group: 'com.google.guava', name: 'guava', version: '32.0.1-jre'
//CVE-2023-36479
implementation group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '9.4.57.v20241219'
//CVE-2023-52428
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: '9.37.3'

implementation('org.apache.zookeeper:zookeeper:3.9.2') {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'log4j', module: 'log4j' // CVE and Ciso mandate
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'ch.qos.logback', module: 'logback-core'
}

// CVEs
implementation (group: 'org.apache.avro', name: 'avro', version: '1.11.4'){
exclude group: 'org.apache.commons', module: 'commons-compress'
}
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.26.2'
implementation group: 'org.apache.commons', name: 'commons-configuration2', version: '2.10.1'
implementation (group: 'org.apache.hadoop', name: 'hadoop-common', version: '3.4.1'){
exclude group: 'org.apache.zookeeper', module: 'zookeeper'
exclude group: 'org.apache.commons', module: 'commons-compress'
}
implementation group: 'dnsjava', name: 'dnsjava', version: '3.6.3'
implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.70'

implementation group: 'io.netty', name: 'netty-codec', version: '4.1.119.Final'
implementation group: 'io.netty', name: 'netty-handler', version: '4.1.119.Final'

implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.0'

//
//CVE-2022-40152
implementation group: 'com.fasterxml.woodstox', name: 'woodstox-core', version: '6.4.0'
//CVE-2022-2048
implementation group: 'org.eclipse.jetty', name: 'jetty-io', version: '9.4.57.v20241219'
implementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.57.v20241219'
//CVE-2022-40149
implementation group: 'org.codehaus.jettison', name: 'jettison', version: '1.5.4'
//CVE-2023-5685
implementation group: 'org.jboss.xnio', name: 'xnio-api', version: '3.8.16.Final'

testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation group: 'com.google.truth', name: 'truth', version: '1.0'
testImplementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jacksonCompatibilityVersion
testImplementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonDatabindVersion
testImplementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: jacksonCompatibilityVersion

runtimeOnly group: 'com.boundary', name: 'high-scale-lib', version: '1.0.6'
}
}

subprojects {
apply plugin: 'java'

sourceCompatibility = 21.0
targetCompatibility = 21.0

jacoco {
toolVersion = "0.8.12"
}

tasks.named("spotbugsMain").configure { dependsOn(":spark-addons:jar") }
tasks.named("compileTestJava").configure { dependsOn(":spark-addons:jar") }

// Disable the test report for the individual test task
tasks.withType(com.github.spotbugs.snom.SpotBugsTask){
ignoreFailures = true
reports {
xml.enabled true
html.enabled true
}
}

test {
jvmArgs '--add-exports=java.base/sun.nio.ch=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.nio=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.lang.invoke=ALL-UNNAMED'
jvmArgs '--add-opens=java.base/java.util=ALL-UNNAMED'
ignoreFailures = true
reports {
junitXml.required = true
html.required = true
}
}

task copyReport(type:  Copy) {
from "build/test-results"
into "$rootDir/build/test-results"
}
test.finalizedBy(copyReport)
}

configurations {
implementation.exclude group: 'com.google.code.findbugs', module: 'jsr305'
implementation.exclude group: 'com.google.code.findbugs', module: 'annotations'
implementation.exclude group: 'com.github.spotbugs', module: 'spotbugs-annotations'
implementation.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
implementation.exclude group: 'log4j', module: 'log4j'
}

dependencies { implementation subprojects }

task sparkAPIJar(type: Jar) {
archiveClassifier = 'spark-api'
from project(":spark-api").sourceSets.main.output
from project(":api").sourceSets.main.output

exclude('META-INF/maven/log4j/**')
}

task sparkRuntimeJar(type: ShadowJar) {
archiveClassifier = 'spark'
from project(":spark").sourceSets.main.java
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations = [ project.configurations.runtimeClasspath ]

relocate 'com.google.common', 'eashade.com.google.common'
relocate 'org.roaringbitmap', 'eashade.org.roaringbitmap'
relocate 'okhttp3', 'eashade.okhttp3'
relocate 'okio', 'eashade.okio'

zip64 true

manifest.inheritFrom project.tasks.jar.manifest
exclude ('META-INF/maven/net.minidev/json-smart/**')
exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/maven/log4j','META-INF/maven/net.minidev/json-smart')
exclude '**/libnetty_resolver_dns_native_macos_x86_64.jnilib'
exclude '**/libnetty_resolver_dns_native_macos_aarch_64.jnilib'

exclude('META-INF/maven/log4j/**')
}

task resolverJar(type: Jar) {
archiveClassifier = 'resolver'
from project(":resolver").sourceSets.main.output
from project(":api").sourceSets.main.output
}

task aiPlatformJar(type: Jar) {
archiveClassifier = 'aiplatform'
from project(":aiplatform").sourceSets.main.output
}

build.finalizedBy sparkAPIJar, sparkRuntimeJar, resolverJar, aiPlatformJar
jar.finalizedBy sparkAPIJar, sparkRuntimeJar, resolverJar, aiPlatformJar

task testReport(type: TestReport) {
destinationDir = file("$buildDir/reports/tests/test")
// Include the results from the test task in all subprojects
reportOn subprojects*.test
}

task spotBugsReport(type: TestReport) {
destinationDir = file("$buildDir/reports/spotbugs")
// Include the results from the spotbugs task in all subprojects
reportOn subprojects*.spotbugsTest
reportOn subprojects*.spotbugsMain
}

test.finalizedBy(testReport)
test.finalizedBy(spotBugsReport)

test {
ignoreFailures = true
reports {
junitXml.required = true
html.required = true
}
}

distributions {
main {
baseName = baseName
}
}

publishing {
publications {
mavenJava(MavenPublication) {
artifact sparkAPIJar
artifact sparkRuntimeJar
artifact resolverJar
}
}
}

artifactory {
publish {
defaults {
publications('mavenJava')
publishArtifacts = true
}
}
}

Спасибо

Подробнее здесь: https://stackoverflow.com/questions/796 ... n-65-error
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «JAVA»