-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Verify AnkiDroid works with JDK16 for development #8434
Comments
Oh - I should say sometimes there are errors! JDK11 did not work until we fixed a few things. If there are problems, correcting them as either as independent clean commits on the PR as separate PRs would work |
@mikehardy can I work on this?
If there are many problems that require changes, I will send separate PRs from my branch and link them all to this issue. |
Please do! Thank you @ritvij14 - hopefully it's a quick one, there ...should not be problems? You just never know until you try though :-) |
@mikehardy after following the above tests, I got this result on running the command: FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':api:compileDebugJavaWithJavac'.
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x40668c7d) 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 @0x40668c7d
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':lint-rules:compileJava'.
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0xe8b0f4d) 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 @0xe8b0f4d
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8.3/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1m 24s
20 actionable tasks: 6 executed, 14 from cache I haven't worked with multiple jdk versions on the same project before so will need some help in understanding what needs to be resolved 😅 |
I'm not sure we can resolve it! Wow, that's a very low level 💥 Probably best to wait for the underlying tools to handle JDK16 and until then, our build.gradle warning is valid, we work with 8, 11 and 14 (although it does say latest - and 14 is no longer latest, it's not worth changing at the moment) I'll label this one as blocked on dependency Although if you search in stackoverflow or gradle issue tracker for issues with JDK16 you may find people already discussing the underlying cause |
Note: seeing discussion of the underlying cause would just be for interest - sometimes I find that stuff interesting? - you might And regardless, I appreciate that you gave it a spin, now we know it does not work and all knowledge has some value |
Ok understood. I will give them a read, they do sound interesting, and will move onto another issue for now. |
Gradle 7 will support JDK16 It's on RC2 right now so I imagine it will come soon. This is not a high priority item I was just reading other things, noticed it and am persisting the knowledge as a comment here |
gradle 7 is out and has the support https://docs.gradle.org/7.0/release-notes.html#java-16 |
I gave this an attempt now that we have Gradle 7 working, but the android gradle plugin is the current blocker for JDK16. This isn't a priority but I was in the area. No JDK16 for now, keep using 8 or 11 |
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
Looked at this again as it went stale. https://melix.github.io/blog/2021/03/gradle-java16.html I'm not saying I want to do this as our Java requirements are dominated by the Java requirements of Android devices, but it's a thing. Going to set this to sleep again and wait for "Arctic Fox" to come out to see if it just resolves itself from our perspective via updated major releases (it should) |
Currently JDK16 is the most up to date JDK version available (https://adoptopenjdk.net/archive.html?variant=openjdk16&jvmVariant=hotspot)
AnkiDroid has a test in build.gradle to make sure only JDKs we have verified are used (there have been problems in the past...) So JDK16 is not currently allowed, the most recent allowed is JDK14
The task here is to:
install JDK16 (adoptopenjdk.net is highly recommended - and their builds are typically available via a package manager on your machine, like brew for macos, apt for ubuntu, possibly choco for windows, etc)
alter the build.gradle test so it allows JDK16 then verify when you build AnkiDroid that it is using the JDK16 binary
run
./gradlew clean jacocoTestReport lintRelease
to make sure everything is workingPost a PR with the change the build.gradle test so it allows JDK8 and JDK11 (the two LTS versions of the JDK) as well as 16 (the current version)
Originally posted by @mikehardy in #8387 (comment)
The text was updated successfully, but these errors were encountered: