Mailing List Archive

is gradle supposed to work with java 18?
On my operating system, java package has been upgraded to jdk 18,
since it is the latest release. Do i need to download 17 and stash it
off somewhere else for gradle to work? Is there some other workaround?

Thanks for any pointers.

think:lucene[main]$ git status
On branch main
nothing to commit, working tree clean
think:lucene[main]$ ./gradlew clean
To honour the JVM settings for this build a single-use Daemon process
will be forked. See
https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
> Task :buildSrc:compileJava UP-TO-DATE
> Task :buildSrc:compileGroovy NO-SOURCE
> Task :buildSrc:processResources NO-SOURCE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
> Task :buildSrc:testClasses UP-TO-DATE
> Task :buildSrc:test NO-SOURCE
> Task :buildSrc:check UP-TO-DATE
> Task :buildSrc:build UP-TO-DATE

FAILURE: Build failed with an exception.

* What went wrong:
java.util.concurrent.ExecutionException:
org.gradle.api.GradleException: Failed to create Jar file
/home/rmuir/.gradle/caches/jars-9/71e1d5e88220a15c55f72f3e02142ed9/buildSrc.jar.
> org.gradle.api.GradleException: Failed to create Jar file /home/rmuir/.gradle/caches/jars-9/71e1d5e88220a15c55f72f3e02142ed9/buildSrc.jar.

* 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

BUILD FAILED in 4s
2 actionable tasks: 2 up-to-date

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: is gradle supposed to work with java 18? [ In reply to ]
I passed various flags such as --debug with no help. "Failed to create
Jar file" is an especially crappy error message.

Finally, found the right one: --stacktrace (why isn't this the default?!):

Caused by: java.lang.IllegalArgumentException: Unsupported class file
major version 62
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:196)
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:177)
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:163)
at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.lambda$visitEntries$1(InstrumentingClasspathFileTransformer.java:150)
at org.gradle.internal.classpath.ClasspathWalker.visitJarContents(ClasspathWalker.java:91)
at org.gradle.internal.classpath.ClasspathWalker.visit(ClasspathWalker.java:55)
at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.visitEntries(InstrumentingClasspathFileTransformer.java:148)
at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.lambda$instrument$0(InstrumentingClasspathFileTransformer.java:139)
at org.gradle.internal.classpath.ClasspathBuilder.buildJar(ClasspathBuilder.java:66)
at org.gradle.internal.classpath.ClasspathBuilder.jar(ClasspathBuilder.java:53)
... 10 more

So it looks like gradle has java 18 compatibility issues? Can we
document a workaround or document "don't use this version, download 17
for now" ?

On Mon, Apr 18, 2022 at 10:38 AM Robert Muir <rcmuir@gmail.com> wrote:
>
> On my operating system, java package has been upgraded to jdk 18,
> since it is the latest release. Do i need to download 17 and stash it
> off somewhere else for gradle to work? Is there some other workaround?
>
> Thanks for any pointers.
>
> think:lucene[main]$ git status
> On branch main
> nothing to commit, working tree clean
> think:lucene[main]$ ./gradlew clean
> To honour the JVM settings for this build a single-use Daemon process
> will be forked. See
> https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon.
> Daemon will be stopped at the end of the build
> > Task :buildSrc:compileJava UP-TO-DATE
> > Task :buildSrc:compileGroovy NO-SOURCE
> > Task :buildSrc:processResources NO-SOURCE
> > Task :buildSrc:classes UP-TO-DATE
> > Task :buildSrc:jar UP-TO-DATE
> > Task :buildSrc:assemble UP-TO-DATE
> > Task :buildSrc:compileTestJava NO-SOURCE
> > Task :buildSrc:compileTestGroovy NO-SOURCE
> > Task :buildSrc:processTestResources NO-SOURCE
> > Task :buildSrc:testClasses UP-TO-DATE
> > Task :buildSrc:test NO-SOURCE
> > Task :buildSrc:check UP-TO-DATE
> > Task :buildSrc:build UP-TO-DATE
>
> FAILURE: Build failed with an exception.
>
> * What went wrong:
> java.util.concurrent.ExecutionException:
> org.gradle.api.GradleException: Failed to create Jar file
> /home/rmuir/.gradle/caches/jars-9/71e1d5e88220a15c55f72f3e02142ed9/buildSrc.jar.
> > org.gradle.api.GradleException: Failed to create Jar file /home/rmuir/.gradle/caches/jars-9/71e1d5e88220a15c55f72f3e02142ed9/buildSrc.jar.
>
> * 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
>
> BUILD FAILED in 4s
> 2 actionable tasks: 2 up-to-date

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: is gradle supposed to work with java 18? [ In reply to ]
See: https://github.com/gradle/gradle/issues/19283
Seems it has been fixed in the master branch, but not yet released as
proper build.


On Mon, Apr 18, 2022 at 4:49 PM Robert Muir <rcmuir@gmail.com> wrote:

> I passed various flags such as --debug with no help. "Failed to create
> Jar file" is an especially crappy error message.
>
> Finally, found the right one: --stacktrace (why isn't this the default?!):
>
> Caused by: java.lang.IllegalArgumentException: Unsupported class file
> major version 62
> at org.objectweb.asm.ClassReader.<init>(ClassReader.java:196)
> at org.objectweb.asm.ClassReader.<init>(ClassReader.java:177)
> at org.objectweb.asm.ClassReader.<init>(ClassReader.java:163)
> at
> org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.lambda$visitEntries$1(InstrumentingClasspathFileTransformer.java:150)
> at
> org.gradle.internal.classpath.ClasspathWalker.visitJarContents(ClasspathWalker.java:91)
> at
> org.gradle.internal.classpath.ClasspathWalker.visit(ClasspathWalker.java:55)
> at
> org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.visitEntries(InstrumentingClasspathFileTransformer.java:148)
> at
> org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.lambda$instrument$0(InstrumentingClasspathFileTransformer.java:139)
> at
> org.gradle.internal.classpath.ClasspathBuilder.buildJar(ClasspathBuilder.java:66)
> at
> org.gradle.internal.classpath.ClasspathBuilder.jar(ClasspathBuilder.java:53)
> ... 10 more
>
> So it looks like gradle has java 18 compatibility issues? Can we
> document a workaround or document "don't use this version, download 17
> for now" ?
>
> On Mon, Apr 18, 2022 at 10:38 AM Robert Muir <rcmuir@gmail.com> wrote:
> >
> > On my operating system, java package has been upgraded to jdk 18,
> > since it is the latest release. Do i need to download 17 and stash it
> > off somewhere else for gradle to work? Is there some other workaround?
> >
> > Thanks for any pointers.
> >
> > think:lucene[main]$ git status
> > On branch main
> > nothing to commit, working tree clean
> > think:lucene[main]$ ./gradlew clean
> > To honour the JVM settings for this build a single-use Daemon process
> > will be forked. See
> >
> https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon
> .
> > Daemon will be stopped at the end of the build
> > > Task :buildSrc:compileJava UP-TO-DATE
> > > Task :buildSrc:compileGroovy NO-SOURCE
> > > Task :buildSrc:processResources NO-SOURCE
> > > Task :buildSrc:classes UP-TO-DATE
> > > Task :buildSrc:jar UP-TO-DATE
> > > Task :buildSrc:assemble UP-TO-DATE
> > > Task :buildSrc:compileTestJava NO-SOURCE
> > > Task :buildSrc:compileTestGroovy NO-SOURCE
> > > Task :buildSrc:processTestResources NO-SOURCE
> > > Task :buildSrc:testClasses UP-TO-DATE
> > > Task :buildSrc:test NO-SOURCE
> > > Task :buildSrc:check UP-TO-DATE
> > > Task :buildSrc:build UP-TO-DATE
> >
> > FAILURE: Build failed with an exception.
> >
> > * What went wrong:
> > java.util.concurrent.ExecutionException:
> > org.gradle.api.GradleException: Failed to create Jar file
> >
> /home/rmuir/.gradle/caches/jars-9/71e1d5e88220a15c55f72f3e02142ed9/buildSrc.jar.
> > > org.gradle.api.GradleException: Failed to create Jar file
> /home/rmuir/.gradle/caches/jars-9/71e1d5e88220a15c55f72f3e02142ed9/buildSrc.jar.
> >
> > * 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
> >
> > BUILD FAILED in 4s
> > 2 actionable tasks: 2 up-to-date
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>
Re: is gradle supposed to work with java 18? [ In reply to ]
I guess my problem is that this happens every java release. So maybe
they could remove the unnecessary .class file manipulation, or at
least improve the error message for future java versions?

On Mon, Apr 18, 2022 at 10:58 AM Rob Audenaerde
<rob.audenaerde@gmail.com> wrote:
>
> See: https://github.com/gradle/gradle/issues/19283
> Seems it has been fixed in the master branch, but not yet released as proper build.
>
>
> On Mon, Apr 18, 2022 at 4:49 PM Robert Muir <rcmuir@gmail.com> wrote:
>>
>> I passed various flags such as --debug with no help. "Failed to create
>> Jar file" is an especially crappy error message.
>>
>> Finally, found the right one: --stacktrace (why isn't this the default?!):
>>
>> Caused by: java.lang.IllegalArgumentException: Unsupported class file
>> major version 62
>> at org.objectweb.asm.ClassReader.<init>(ClassReader.java:196)
>> at org.objectweb.asm.ClassReader.<init>(ClassReader.java:177)
>> at org.objectweb.asm.ClassReader.<init>(ClassReader.java:163)
>> at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.lambda$visitEntries$1(InstrumentingClasspathFileTransformer.java:150)
>> at org.gradle.internal.classpath.ClasspathWalker.visitJarContents(ClasspathWalker.java:91)
>> at org.gradle.internal.classpath.ClasspathWalker.visit(ClasspathWalker.java:55)
>> at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.visitEntries(InstrumentingClasspathFileTransformer.java:148)
>> at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.lambda$instrument$0(InstrumentingClasspathFileTransformer.java:139)
>> at org.gradle.internal.classpath.ClasspathBuilder.buildJar(ClasspathBuilder.java:66)
>> at org.gradle.internal.classpath.ClasspathBuilder.jar(ClasspathBuilder.java:53)
>> ... 10 more
>>
>> So it looks like gradle has java 18 compatibility issues? Can we
>> document a workaround or document "don't use this version, download 17
>> for now" ?
>>
>> On Mon, Apr 18, 2022 at 10:38 AM Robert Muir <rcmuir@gmail.com> wrote:
>> >
>> > On my operating system, java package has been upgraded to jdk 18,
>> > since it is the latest release. Do i need to download 17 and stash it
>> > off somewhere else for gradle to work? Is there some other workaround?
>> >
>> > Thanks for any pointers.
>> >
>> > think:lucene[main]$ git status
>> > On branch main
>> > nothing to commit, working tree clean
>> > think:lucene[main]$ ./gradlew clean
>> > To honour the JVM settings for this build a single-use Daemon process
>> > will be forked. See
>> > https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon.
>> > Daemon will be stopped at the end of the build
>> > > Task :buildSrc:compileJava UP-TO-DATE
>> > > Task :buildSrc:compileGroovy NO-SOURCE
>> > > Task :buildSrc:processResources NO-SOURCE
>> > > Task :buildSrc:classes UP-TO-DATE
>> > > Task :buildSrc:jar UP-TO-DATE
>> > > Task :buildSrc:assemble UP-TO-DATE
>> > > Task :buildSrc:compileTestJava NO-SOURCE
>> > > Task :buildSrc:compileTestGroovy NO-SOURCE
>> > > Task :buildSrc:processTestResources NO-SOURCE
>> > > Task :buildSrc:testClasses UP-TO-DATE
>> > > Task :buildSrc:test NO-SOURCE
>> > > Task :buildSrc:check UP-TO-DATE
>> > > Task :buildSrc:build UP-TO-DATE
>> >
>> > FAILURE: Build failed with an exception.
>> >
>> > * What went wrong:
>> > java.util.concurrent.ExecutionException:
>> > org.gradle.api.GradleException: Failed to create Jar file
>> > /home/rmuir/.gradle/caches/jars-9/71e1d5e88220a15c55f72f3e02142ed9/buildSrc.jar.
>> > > org.gradle.api.GradleException: Failed to create Jar file /home/rmuir/.gradle/caches/jars-9/71e1d5e88220a15c55f72f3e02142ed9/buildSrc.jar.
>> >
>> > * 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
>> >
>> > BUILD FAILED in 4s
>> > 2 actionable tasks: 2 up-to-date
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: is gradle supposed to work with java 18? [ In reply to ]
+1

Mike McCandless

http://blog.mikemccandless.com


On Mon, Apr 18, 2022 at 5:43 PM Robert Muir <rcmuir@gmail.com> wrote:

> I guess my problem is that this happens every java release. So maybe
> they could remove the unnecessary .class file manipulation, or at
> least improve the error message for future java versions?
>
> On Mon, Apr 18, 2022 at 10:58 AM Rob Audenaerde
> <rob.audenaerde@gmail.com> wrote:
> >
> > See: https://github.com/gradle/gradle/issues/19283
> > Seems it has been fixed in the master branch, but not yet released as
> proper build.
> >
> >
> > On Mon, Apr 18, 2022 at 4:49 PM Robert Muir <rcmuir@gmail.com> wrote:
> >>
> >> I passed various flags such as --debug with no help. "Failed to create
> >> Jar file" is an especially crappy error message.
> >>
> >> Finally, found the right one: --stacktrace (why isn't this the
> default?!):
> >>
> >> Caused by: java.lang.IllegalArgumentException: Unsupported class file
> >> major version 62
> >> at org.objectweb.asm.ClassReader.<init>(ClassReader.java:196)
> >> at org.objectweb.asm.ClassReader.<init>(ClassReader.java:177)
> >> at org.objectweb.asm.ClassReader.<init>(ClassReader.java:163)
> >> at
> org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.lambda$visitEntries$1(InstrumentingClasspathFileTransformer.java:150)
> >> at
> org.gradle.internal.classpath.ClasspathWalker.visitJarContents(ClasspathWalker.java:91)
> >> at
> org.gradle.internal.classpath.ClasspathWalker.visit(ClasspathWalker.java:55)
> >> at
> org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.visitEntries(InstrumentingClasspathFileTransformer.java:148)
> >> at
> org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.lambda$instrument$0(InstrumentingClasspathFileTransformer.java:139)
> >> at
> org.gradle.internal.classpath.ClasspathBuilder.buildJar(ClasspathBuilder.java:66)
> >> at
> org.gradle.internal.classpath.ClasspathBuilder.jar(ClasspathBuilder.java:53)
> >> ... 10 more
> >>
> >> So it looks like gradle has java 18 compatibility issues? Can we
> >> document a workaround or document "don't use this version, download 17
> >> for now" ?
> >>
> >> On Mon, Apr 18, 2022 at 10:38 AM Robert Muir <rcmuir@gmail.com> wrote:
> >> >
> >> > On my operating system, java package has been upgraded to jdk 18,
> >> > since it is the latest release. Do i need to download 17 and stash it
> >> > off somewhere else for gradle to work? Is there some other workaround?
> >> >
> >> > Thanks for any pointers.
> >> >
> >> > think:lucene[main]$ git status
> >> > On branch main
> >> > nothing to commit, working tree clean
> >> > think:lucene[main]$ ./gradlew clean
> >> > To honour the JVM settings for this build a single-use Daemon process
> >> > will be forked. See
> >> >
> https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon
> .
> >> > Daemon will be stopped at the end of the build
> >> > > Task :buildSrc:compileJava UP-TO-DATE
> >> > > Task :buildSrc:compileGroovy NO-SOURCE
> >> > > Task :buildSrc:processResources NO-SOURCE
> >> > > Task :buildSrc:classes UP-TO-DATE
> >> > > Task :buildSrc:jar UP-TO-DATE
> >> > > Task :buildSrc:assemble UP-TO-DATE
> >> > > Task :buildSrc:compileTestJava NO-SOURCE
> >> > > Task :buildSrc:compileTestGroovy NO-SOURCE
> >> > > Task :buildSrc:processTestResources NO-SOURCE
> >> > > Task :buildSrc:testClasses UP-TO-DATE
> >> > > Task :buildSrc:test NO-SOURCE
> >> > > Task :buildSrc:check UP-TO-DATE
> >> > > Task :buildSrc:build UP-TO-DATE
> >> >
> >> > FAILURE: Build failed with an exception.
> >> >
> >> > * What went wrong:
> >> > java.util.concurrent.ExecutionException:
> >> > org.gradle.api.GradleException: Failed to create Jar file
> >> >
> /home/rmuir/.gradle/caches/jars-9/71e1d5e88220a15c55f72f3e02142ed9/buildSrc.jar.
> >> > > org.gradle.api.GradleException: Failed to create Jar file
> /home/rmuir/.gradle/caches/jars-9/71e1d5e88220a15c55f72f3e02142ed9/buildSrc.jar.
> >> >
> >> > * 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
> >> >
> >> > BUILD FAILED in 4s
> >> > 2 actionable tasks: 2 up-to-date
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: dev-help@lucene.apache.org
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>