Aiven-Open / tiered-storage-for-apache-kafka

RemoteStorageManager for Apache Kafka® Tiered Storage
Apache License 2.0
95 stars 20 forks source link

How can I compile the project? #499

Closed funky-eyes closed 8 months ago

funky-eyes commented 8 months ago

What can we help you with?

I tried to compile using jdk17 and jdk21, the error is the same, can't compile through, I don't know what to do to compile successfully, please help me to see this problem, thanks!

> Task :core:integrationTest
java.lang.instrument.IllegalClassFormatException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo.
        at org.jacoco.agent.rt.internal_f3994fa.CoverageTransformer.transform(CoverageTransformer.java:94)
        at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
        at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:610)
        at java.base/java.lang.ClassLoader.defineClass2(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1118)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:182)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:741)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:621)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:638)
        at java.base/java.lang.Class.forName(Class.java:625)
        at java.base/java.lang.Class.forName(Class.java:600)
        at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:859)
        at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1084)
        at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
        at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
        at java.base/sun.util.cldr.CLDRLocaleProviderAdapter.lambda$new$0(CLDRLocaleProviderAdapter.java:84)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:571)
        at java.base/sun.util.cldr.CLDRLocaleProviderAdapter.<init>(CLDRLocaleProviderAdapter.java:83)
        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 java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:194)
        at java.base/sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:293)
        at java.base/sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:264)
        at java.base/java.util.Calendar.createCalendar(Calendar.java:1696)
        at java.base/java.util.Calendar.getInstance(Calendar.java:1663)
        at java.base/java.text.SimpleDateFormat.initializeCalendar(SimpleDateFormat.java:680)
        at java.base/java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:624)
        at java.base/java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:603)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.getLastResortErrorLogFile(SystemApplicationClassLoaderWorker.java:162)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:111)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
        at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
        at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: java.io.IOException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo.
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrumentError(Instrumenter.java:160)
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:110)
        at org.jacoco.agent.rt.internal_f3994fa.CoverageTransformer.transform(CoverageTransformer.java:92)
        ... 35 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 65
        at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:196)
        at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:177)
        at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:163)
        at org.jacoco.agent.rt.internal_f3994fa.core.internal.instr.InstrSupport.classReaderFor(InstrSupport.java:280)
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:76)
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:108)
        ... 36 more
java.lang.instrument.IllegalClassFormatException: Error while instrumenting sun/util/resources/provider/LocaleDataProvider.
        at org.jacoco.agent.rt.internal_f3994fa.CoverageTransformer.transform(CoverageTransformer.java:94)
        at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
        at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:610)
        at java.base/java.lang.ClassLoader.defineClass2(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1118)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:182)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:741)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:621)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:638)
        at java.base/java.lang.Class.forName(Class.java:625)
        at java.base/java.lang.Class.forName(Class.java:600)
        at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:859)
        at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1084)
        at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
        at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
        at java.base/sun.util.resources.Bundles$2.run(Bundles.java:267)
        at java.base/sun.util.resources.Bundles$2.run(Bundles.java:265)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
        at java.base/sun.util.resources.Bundles.loadBundleFromProviders(Bundles.java:264)
        at java.base/sun.util.resources.Bundles.findBundleOf(Bundles.java:201)
        at java.base/sun.util.resources.Bundles.findBundleOf(Bundles.java:160)
        at java.base/sun.util.resources.Bundles.findBundleOf(Bundles.java:160)
        at java.base/sun.util.resources.Bundles.findBundleOf(Bundles.java:160)
        at java.base/sun.util.resources.Bundles.loadBundleOf(Bundles.java:145)
        at java.base/sun.util.resources.Bundles.of(Bundles.java:106)
        at java.base/sun.util.resources.LocaleData$1.run(LocaleData.java:185)
        at java.base/sun.util.resources.LocaleData$1.run(LocaleData.java:182)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
        at java.base/sun.util.resources.LocaleData.getBundle(LocaleData.java:182)
        at java.base/sun.util.resources.LocaleData.getDateFormatData(LocaleData.java:145)
        at java.base/java.text.DateFormatSymbols.initializeData(DateFormatSymbols.java:747)
        at java.base/java.text.DateFormatSymbols.<init>(DateFormatSymbols.java:151)
        at java.base/sun.util.locale.provider.DateFormatSymbolsProviderImpl.getInstance(DateFormatSymbolsProviderImpl.java:85)
        at java.base/java.text.DateFormatSymbols.getProviderInstance(DateFormatSymbols.java:371)
        at java.base/java.text.DateFormatSymbols.getInstanceRef(DateFormatSymbols.java:361)
        at java.base/java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:626)
        at java.base/java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:603)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.getLastResortErrorLogFile(SystemApplicationClassLoaderWorker.java:162)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:111)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
        at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
        at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: java.io.IOException: Error while instrumenting sun/util/resources/provider/LocaleDataProvider.
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrumentError(Instrumenter.java:160)
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:110)
        at org.jacoco.agent.rt.internal_f3994fa.CoverageTransformer.transform(CoverageTransformer.java:92)
        ... 43 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 65
        at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:196)
        at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:177)
        at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:163)
        at org.jacoco.agent.rt.internal_f3994fa.core.internal.instr.InstrSupport.classReaderFor(InstrSupport.java:280)
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:76)
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:108)
        ... 44 more
java.lang.instrument.IllegalClassFormatException: Error while instrumenting sun/text/resources/cldr/ext/FormatData_zh.
        at org.jacoco.agent.rt.internal_f3994fa.CoverageTransformer.transform(CoverageTransformer.java:94)
        at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
        at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:610)
        at java.base/java.lang.ClassLoader.defineClass2(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1118)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:182)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:741)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:621)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:638)
        at java.base/java.lang.Class.forName(Class.java:625)
        at java.base/java.lang.Class.forName(Class.java:600)
        at jdk.localedata/sun.util.resources.provider.LocaleDataProvider.loadResourceBundle(LocaleDataProvider.java:54)
        at jdk.localedata/sun.util.resources.provider.LocaleDataProvider.getBundle(LocaleDataProvider.java:40)
        at java.base/sun.util.resources.Bundles$2.run(Bundles.java:270)
        at java.base/sun.util.resources.Bundles$2.run(Bundles.java:265)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
        at java.base/sun.util.resources.Bundles.loadBundleFromProviders(Bundles.java:264)
        at java.base/sun.util.resources.Bundles.findBundleOf(Bundles.java:201)
        at java.base/sun.util.resources.Bundles.findBundleOf(Bundles.java:160)
        at java.base/sun.util.resources.Bundles.findBundleOf(Bundles.java:160)
        at java.base/sun.util.resources.Bundles.findBundleOf(Bundles.java:160)
        at java.base/sun.util.resources.Bundles.loadBundleOf(Bundles.java:145)
        at java.base/sun.util.resources.Bundles.of(Bundles.java:106)
        at java.base/sun.util.resources.LocaleData$1.run(LocaleData.java:185)
        at java.base/sun.util.resources.LocaleData$1.run(LocaleData.java:182)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
        at java.base/sun.util.resources.LocaleData.getBundle(LocaleData.java:182)
        at java.base/sun.util.resources.LocaleData.getDateFormatData(LocaleData.java:145)
        at java.base/java.text.DateFormatSymbols.initializeData(DateFormatSymbols.java:747)
        at java.base/java.text.DateFormatSymbols.<init>(DateFormatSymbols.java:151)
        at java.base/sun.util.locale.provider.DateFormatSymbolsProviderImpl.getInstance(DateFormatSymbolsProviderImpl.java:85)
        at java.base/java.text.DateFormatSymbols.getProviderInstance(DateFormatSymbols.java:371)
        at java.base/java.text.DateFormatSymbols.getInstanceRef(DateFormatSymbols.java:361)
        at java.base/java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:626)
        at java.base/java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:603)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.getLastResortErrorLogFile(SystemApplicationClassLoaderWorker.java:162)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:111)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
        at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
        at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: java.io.IOException: Error while instrumenting sun/text/resources/cldr/ext/FormatData_zh.
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrumentError(Instrumenter.java:160)
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:110)
        at org.jacoco.agent.rt.internal_f3994fa.CoverageTransformer.transform(CoverageTransformer.java:92)
        ... 41 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 65
        at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:196)
        at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:177)
        at org.jacoco.agent.rt.internal_f3994fa.asm.ClassReader.<init>(ClassReader.java:163)
        at org.jacoco.agent.rt.internal_f3994fa.core.internal.instr.InstrSupport.classReaderFor(InstrSupport.java:280)
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:76)
        at org.jacoco.agent.rt.internal_f3994fa.core.instr.Instrumenter.instrument(Instrumenter.java:108)
        ... 42 more

> Task :e2e:distTar FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':e2e:distTar'.
> Could not resolve all files for configuration ':e2e:runtimeClasspath'.
   > Could not resolve com.google.guava:guava:32.1.3-jre.
     Required by:
         project :e2e > com.google.cloud:google-cloud-storage:2.32.1
      > The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally. However we cannot choose between the following variants of com.google.guava:guava:32.1.3-jre:
          - androidRuntimeElements
          - jreRuntimeElements
        All of them match the consumer attributes:
          - Variant 'androidRuntimeElements' capabilities com.google.collections:google-collections:32.1.3-jre and com.google.guava:guava:32.1.3-jre declares a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally:
              - Unmatched attributes:
                  - Provides attribute 'org.gradle.jvm.environment' with value 'android' but the consumer didn't ask for it
                  - Provides release status but the consumer didn't ask for it
          - Variant 'jreRuntimeElements' capabilities com.google.collections:google-collections:32.1.3-jre and com.google.guava:guava:32.1.3-jre declares a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally:
              - Unmatched attributes:
                  - Provides attribute 'org.gradle.jvm.environment' with value 'standard-jvm' but the consumer didn't ask for it
                  - Provides release status but the consumer didn't ask for it
        The following variants were also considered but didn't match the requested attributes:
          - Variant 'androidApiElements' capabilities com.google.collections:google-collections:32.1.3-jre and com.google.guava:guava:32.1.3-jre declares a library compatible with Java 8, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component and the consumer needed a runtime of a component
          - Variant 'jreApiElements' capabilities com.google.collections:google-collections:32.1.3-jre and com.google.guava:guava:32.1.3-jre declares a library compatible with Java 8, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component and the consumer needed a runtime of a component

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Where would you expect to find this information?

jeqo commented 8 months ago

Seems that the error is related to a gradle plugin. Could you confirm which JVM is Gradle using? e.g. https://stackoverflow.com/a/67101848/4113777

funky-eyes commented 8 months ago

Seems that the error is related to a gradle plugin. Could you confirm which JVM is Gradle using? e.g. https://stackoverflow.com/a/67101848/4113777

Is it possible that my local gradle version is too low, I will try to upgrade it to 8.1.1


------------------------------------------------------------
Gradle 6.9.2
------------------------------------------------------------

Build time:   2021-12-21 20:18:38 UTC
Revision:     5d94aa68c0fdbe443838bb977080e3b9f273e889

Kotlin:       1.4.20
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          21 (Oracle Corporation 21+35-2513)
OS:           Mac OS X 13.5 aarch64
jeqo commented 8 months ago

Right. Also, if you run make build or ./gradlew ... it should use the version declared by the project.

funky-eyes commented 8 months ago

Thank you very much, I've compiled it