-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Adding support for JDK17 and removing JDK8 #2025
Adding support for JDK17 and removing JDK8 #2025
Conversation
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Can one of the admins verify this patch? |
Gradle check is failing
|
@@ -11,7 +11,12 @@ | |||
|
|||
org.gradle.warning.mode=none | |||
org.gradle.parallel=true | |||
org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Xss2m | |||
org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Xss2m \ | |||
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering why these exports are needed? AFAIK OpenSearch does not use Java Compiler API, do you have an example at hand? Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey Andriy,
Options are required to overcome the issue from spotlessJavaCheck
task, it's called from OS formatting.gradle script.
example of stack-trace:
Caused by: java.lang.IllegalAccessError: class com.google.googlejavaformat.java.RemoveUnusedImports (in unnamed module @0x63239047) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x63239047
at com.google.googlejavaformat.java.RemoveUnusedImports.removeUnusedImports(RemoveUnusedImports.java:187)
... 139 more
some public discussions on the issue and possible workaround - google/google-java-format#612, https://stackoverflow.com/questions/58082298/gradle-run-with-add-exports, https://zenn.dev/yuta_saito/articles/8b185a3786088b.
^ @reta
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ... thank you @martin-gaievski , spotless
again ...
hey Suraj, |
start gradle check |
Hehe ... @owaiskazi19 seems like without our #2024 PR merged, not much hope for builds to succeed :(
|
Yeah. Looks like all the build failed for the same reason. PR is merged. Starting gradle check again. |
start gradle check |
|
start gradle check |
This overlaps with #1977. @martin-gaievski want to merge these two and update docs? |
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
sure, added changes from #1977 so now this PR consolidates all changes |
The developer guide needs to be updated as well. |
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Ack, updated in next commit |
|
||
To run the full suite of tests, download and install [JDK 8](https://adoptium.net/releases.html?variant=openjdk8) and [JDK 14](https://jdk.java.net/archive/) and set `JAVA8_HOME`, `JAVA11_HOME`, and `JAVA14_HOME`. They are required by the [backwards compatibility test](./TESTING.md#testing-backwards-compatibility). | ||
To run the full suite of tests, download and install [JDK 14](https://jdk.java.net/archive/) and set `JAVA11_HOME`, and `JAVA14_HOME`. They are required by the [backwards compatibility test](./TESTING.md#testing-backwards-compatibility). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martin-gaievski this is interesting, we are not going to backport this change to 1.x, right? In this case, I am not sure we have to drop the JDK-8 requirements for bwc tests, did you have a chance to check it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All set, thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @martin-gaievski, thanks!
Description
Making necessary adjustments to make build compatible with JDK17:
add-exports
arguments due tojava.lang.IllegalAccessError
whenspotlessJavaCheck
uses classes fromcom.sun.*
-Werror
optionChanging runtime java version from 8 to 11.
Issues Resolved
Remove support for Java 8, add support for Java 17
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.