question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building with Gradle 7 on Java 16 fails

See original GitHub issue

CrateDB version: 4.5.0

Environment description: FreeBSD 12.2

$ /usr/local/openjdk16/bin/java -version
openjdk version "16" 2021-03-16
OpenJDK Runtime Environment (build 16+36-1)
OpenJDK 64-Bit Server VM (build 16+36-1, mixed mode, sharing)

Problem description:

===>  Building for crate-db-4.5.0
cd /disk-samsung/freebsd-ports/databases/crate/work/crate-4.5.0 && /usr/bin/env JAVA_HOME=/usr/local/openjdk16 XDG_DATA_HOME=/disk-samsung/freebsd-ports/databases/crate/work  XDG_CONFIG_HOME=/disk-samsung/freebsd-ports/databases/crate/work  HOME=/disk-samsung/freebsd-ports/databases/crate/work PATH=/disk-samsung/freebsd-ports/databases/crate/work/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS="-fno-omit-frame-pointer"  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" gradle  --gradle-user-home /tmp/gradle-crate --project-cache-dir /tmp/gradle-crate   --build-cache jar
Starting a Gradle Daemon, 1 incompatible and 3 stopped Daemons could not be reused, use --status for details
Watching the file system is not supported on this operating system.
> 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 @0x11a1cf3) 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 @0x11a1cf3

* 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.

Building with Java 11 also fails:

$ /usr/local/openjdk11/bin/java -version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9-1)
OpenJDK 64-Bit Server VM (build 11.0.10+9-1, mixed mode)
===>  Building for crate-db-4.5.0
cd /disk-samsung/freebsd-ports/databases/crate/work/crate-4.5.0 && /usr/bin/env JAVA_HOME=/usr/local/openjdk11 XDG_DATA_HOME=/disk-samsung/freebsd-ports/databases/crate/work  XDG_CONFIG_HOME=/disk-samsung/freebsd-ports/databases/crate/work  HOME=/disk-samsung/freebsd-ports/databases/crate/work PATH=/disk-samsung/freebsd-ports/databases/crate/work/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS="-fno-omit-frame-pointer"  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" gradle  --gradle-user-home /tmp/gradle-crate --project-cache-dir /tmp/gradle-crate   --build-cache jar
Watching the file system is not supported on this operating system.
> Task :buildSrc:compileJava
> Task :buildSrc:compileGroovy NO-SOURCE
> Task :buildSrc:pluginDescriptors
> Task :buildSrc:processResources
> Task :buildSrc:classes
> Task :buildSrc:jar
> Task :buildSrc:assemble
> Task :buildSrc:pluginUnderTestMetadata
> Task :buildSrc:compileTestJava FROM-CACHE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources
> Task :buildSrc:testClasses

> Task :buildSrc:test
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/local/share/gradle/lib/groovy-all-1.3-2.5.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yurivictcommented, Apr 14, 2021

With gradle-6.8.3 and Java 15 it passes this point.

Thank you.

0reactions
LutzWeischerFujitsucommented, Apr 21, 2021

OK, so you can close it. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Support for running under Java 16 requires Gradle 7 ...
For IntelliJ, run the genIntellijRuns gradle task (gradlew genIntellijRuns). And this what i have: FAILURE: Build failed with an exception. * ...
Read more >
Java 16 not working? - Help/Discuss - Gradle Forums
I am trying to make a fabric mod, but I cannot even start, as for some reason, when I launch vscode, it comes...
Read more >
Cédric Champeau's blog: Using Java 16 with Gradle
Java 16 is out and I'm seeing a number of folks trying to figure out how to use Java 16 with Gradle. Often...
Read more >
Should be able to create a valid gradle project for Java 17 ...
The Gradle supports JDK versions 7 through 16. ... it would be great to see the new project wizard not fail when creating...
Read more >
FYI: gradle is not yet compatible with Java 16 - Reddit
If you try and build a gradle-based project with Java 16 you will ... Task :buildSrc:validatePlugins FAILED FAILURE: Build failed with an ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found