Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building with Java 17 #1062

Open
LIttleAncientForestKami opened this issue Jan 15, 2022 · 7 comments
Open

Support building with Java 17 #1062

LIttleAncientForestKami opened this issue Jan 15, 2022 · 7 comments

Comments

@LIttleAncientForestKami

Hi there folks!

First of all, wanted to thank you soundly. Really, this is impressive, both the idea and the execution. Thank you a lot for your work.

Kudos to the entire team. <confetti, fanfares, horns blaring, roaring applause>

Again, I'm really grateful for your work done on this project guys.

The issue I found has a workaround - namely, lower Java to 11. I tried running freshly coded repo, from master, on XUbuntu with Java 17, via Gradle wrapper, via installed Gradle and failed on both accounts - with different error messages. Succeeded when I lowered Java to 11 and

Java 17, Gradle 7.2 (via wrapper) - fails on npm dependencies

Welcome to Gradle 7.2!

Here are the highlights of this release:
[...]
For more details see https://docs.gradle.org/7.2/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

> Task :buildSrc:jar
:jar: No valid plugin descriptors were found in META-INF/gradle-plugins

> Task :installNpmDeps FAILED
Downloading https://nodejs.org/dist/v10.24.1/node-v10.24.1-linux-x64.tar.xz
Unpacking /home/myUser/.gradle/native-binaries/nodejs/native-binaries/nodejs/node-v10.24.1-linux-x64.tar/9wklcpvdlbpoa075kk0os7g4x/node-v10.24.1-linux-x64.tar.xz to /home/myUser/.gradle/native-binaries/nodejs/native-binaries/nodejs/node-v10.24.1-linux-x64.tar/9wklcpvdlbpoa075kk0os7g4x

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':installNpmDeps'.
> Error while evaluating property 'environmentProvider' of task ':installNpmDeps'
   > java.lang.reflect.UndeclaredThrowableException (no error message)

* 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 3m 49s
12 actionable tasks: 12 executed

Gradle 6.2, installed, not via wrapper

√ zap-hud  +main+ $ gradle runZap

Welcome to Gradle 6.8.1!

Here are the highlights of this release:
[...]
For more details see https://docs.gradle.org/6.8.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :buildSrc:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSrc:compileJava'.
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x340dcbd0) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x340dcbd0

* 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 36s
?1 zap-hud  +main+ $ java -version 
openjdk version "17" 2021-09-14
OpenJDK Runtime Environment (build 17+35-2724)
OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)

But lowering Java to 11 solved the problem and launched the tool (did NOT attempt via wrapper with Java 11 so this may be a different issue).

Again, thank you for your work guys. Hope this helps.

@kingthorin
Copy link
Member

kingthorin commented Jan 15, 2022

Java 17 requires Gradle 7.3.

I just started looking into upgrading ZAP builds to Gradle 7.3.3 yesterday 🙂.

@kingthorin kingthorin self-assigned this Jan 15, 2022
@kingthorin kingthorin added dependencies Pull requests that update a dependency file java labels Jan 15, 2022
@thc202 thc202 changed the title Java 17 support issue - ZAP HUD from master doesn't start till Java is lowered to 11 Support building with Java 17 Jan 15, 2022
@kingthorin
Copy link
Member

@LIttleAncientForestKami ciuld you update your cloned copy and give this a try again?

@thc202
Copy link
Member

thc202 commented Jan 18, 2022

It fails with same error:

Execution failed for task ':installNpmDeps'.
> Error while evaluating property 'environmentProvider' of task ':installNpmDeps'
   > java.lang.reflect.UndeclaredThrowableException (no error message)

The npm plugin might need to be updated.

@LIttleAncientForestKami
Copy link
Author

@kingthorin that is one fast tempo, oh Oakenshield!

√ zap-hud  +main+ $ java -version
openjdk version "17" 2021-09-14
OpenJDK Runtime Environment (build 17+35-2724)
OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)
√ zap-hud  +main+ $ ./gradlew runZap                                   [INSERT]
Downloading https://services.gradle.org/distributions/gradle-7.3.3-all.zip
...............10%...............20%...............30%...............40%...............50%...............60%................70%...............80%...............90%...............100%

Welcome to Gradle 7.3.3!

Here are the highlights of this release:
 - Easily declare new test suites in Java projects
 - Support for Java 17
 - Support for Scala 3

For more details see https://docs.gradle.org/7.3.3/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

> Task :buildSrc:jar
:jar: No valid plugin descriptors were found in META-INF/gradle-plugins

> Task :installNpmDeps FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':installNpmDeps'.
> Error while evaluating property 'environmentProvider' of task ':installNpmDeps'
   > java.lang.reflect.UndeclaredThrowableException (no error message)

* 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 1m 21s
11 actionable tasks: 11 executed

I ran build scan for details, here you go: https://scans.gradle.com/s/yxpjba3ajjsku/

@kingthorin
Copy link
Member

Thanks!

@kingthorin
Copy link
Member

There "seems" to be something more to this. The dependencyUpdates task doesn't seem to suggest anything that I would think is related, it claims the npm plugin is up-to-date:

$ ./gradlew dependencyUpdates
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :buildSrc:jar
:jar: No valid plugin descriptors were found in META-INF/gradle-plugins

> Task :dependencyUpdates

------------------------------------------------------------
: Project Dependency Updates (report to plain text file)
------------------------------------------------------------

The following dependencies are using the latest milestone version:
 - org.hamcrest:hamcrest-all:1.3
 - org.ysb33r.nodejs.npm:org.ysb33r.nodejs.npm.gradle.plugin:0.12.1
 - org.zaproxy.add-on:org.zaproxy.add-on.gradle.plugin:0.8.0
 - org.zaproxy.crowdin:org.zaproxy.crowdin.gradle.plugin:0.2.1

The following dependencies have later milestone versions:
 - com.diffplug.spotless:com.diffplug.spotless.gradle.plugin [5.17.1 -> 6.2.0]
 - com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin [0.39.0 -> 0.41.0]
 - io.github.bonigarcia:selenium-jupiter [3.4.0 -> 4.0.1]
     https://bonigarcia.dev/selenium-jupiter
 - org.junit.jupiter:junit-jupiter-api [5.8.1 -> 5.8.2]
     https://junit.org/junit5/
 - org.junit.jupiter:junit-jupiter-engine [5.8.1 -> 5.8.2]
     https://junit.org/junit5/
 - org.junit.jupiter:junit-jupiter-params [5.8.1 -> 5.8.2]
     https://junit.org/junit5/
 - org.mockito:mockito-all [1.10.19 -> 2.0.2-beta]
     http://www.mockito.org

Gradle release-candidate updates:
 - Gradle: [7.3.3 -> 7.4-rc-1]

Generated report file C:\Rick\ZAP_DEV\git\zap-hud\build\dependencyUpdates\report.txt

BUILD SUCCESSFUL in 3m 20s
10 actionable tasks: 10 executed

@kingthorin kingthorin removed their assignment Jan 19, 2022
@kingthorin kingthorin removed java dependencies Pull requests that update a dependency file labels Jan 19, 2022
@thc202
Copy link
Member

thc202 commented Jan 19, 2022

I didn't check if a newer version of the plugin was available just assumed it would need a newer one (since this version is broken).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants