-
Notifications
You must be signed in to change notification settings - Fork 746
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
[Discussion] Increasing minimum supported JDK (and dropping support for JDK 11) #3803
Comments
Great topic. Some n=1 feedback: all Picnic-internal code targets JDK 17. For Error Prone Support we kept the baseline at JDK 11, but that does impede the use of text blocks in unit tests which is a shame, because they would be a great quality of life improvement i.c.w. |
Dropping JDK 11 in 2023 would be premature. Where I work, we have not migrated everything off of JDK 8 yet. Any place that has a large codebase to maintain, especially libraries that are still in use by JDK 8 / 11 applications, will have a long road ahead of them to get to 17. |
Thanks! That sort of input is why I opened the issue. When we eventually do start requiring JDK 17 to run Error Prone I don't want that to be too onerous. It'll still be possible to continue to use older versions of Error Prone to get compatibility with older JDK versions, but we also don't want to do that too soon and cause fragmentation. One thing to note is that using JDK 17 to run javac during the build doesn't prevent building code that is deployed to JDK 8, the compiler just has to be configured with At Google we aren't using JDK 8 anymore, and are using the latest javac to build while still supporting deployments to JDK 11. |
True about older versions. As long as it is a major version update to require min jdk 17, should be clear what to expect. |
I think it's too early to drop support for Java 11. Even the upcoming version 3 of the Quarkus framework still has Java 11 as the baseline. |
We use Java 11 extensively and would prefer support is retained until it is out of LTS (2026?). |
@alexec do you know if using a newer javac version and passing |
@cushon using |
We have 1000s of applications on Java 11. It's not feasible to migrate them. |
That is not accurate, (There are some situations
Understood, to be clear that is not what I was asking. It's possible to use a newer version of javac at compile-time and still use an older JDK version in production, javac has support for targeting old JDK versions. E.g.:
|
@cushon have you tried it yourself? I have, and in my case it didn't work without |
Yes
Do you have an example of what didn't work?
It doesn't need a JDK 11, recent versions package data on the APIs for different JDK versions to allow cross-compilation. Demo:
Compilation with
Compilation with
|
|
@cushon, I just checked |
BTW I found out why it didn't work in my project. I used Gradle and set So, I simply didn't use Thanks! |
Going to join the chorus of voices here saying this is likely premature... It's not just a matter of the target source code/bytecode being accepted/generated. Upgrading the java compiler binary itself can be an involved process which interacts with other aspects of our monorepo build system, development environment (and CI) containers, and tooling (e.g. other Javac Plugins). Currently, for us (Uber), the work to migrate to JDK 17 is planned for next year and it's dependent on first migrating build systems (to bazel from buck, which I don't believe supports Java 17). It's extremely unlikely we would be able to get there within the next couple Error Prone releases and thus this would likely mean keeping the internal Error Prone version at whichever is the latest to support JDK 11. |
Thanks @lazaroclapp. At Google we switched to using the latest version of javac around JDK 19, and have been able to continue to track the latest releases for javac, even though we're still using JDK 11 extensively in production. I definitely appreciate that upgrading just the javac version isn't effortless, though. |
@cushon does this mean tracking for example java 20 and 21 as new versions of java come out? But specifically with |
We've been using the latest versions of javac as they're released at Google, but to be clear Error Prone will not require using the latest JDK release. If it eventually drops support for running on JDK 11 the next minimum supported version will probably be 17. (And in terms of why Google is using recent versions of javac: we're using the same version of javac for everything in our monorepo, and doing smaller upgrades more frequently is less work, and having a recent javac version is a prerequisite for being able to use newer language features.) |
@cushon I'm not sure if I should open a separate issue for this, but one thing that impacts NullAway is that Error Prone does not yet have a |
Filing a separate issue for that SGTM, I don't think that is being tracked anywhere yet. I am not sure what all of the options are and am open to ideas. Increasing the minimum supported JDK would certainly make things like that easier, but there might be alternatives we could look at that used reflection etc. and avoided direct references to |
We are currently using latest errorprone version to check code that targets Java 5, 6, and 7 (don't ask why). Java 5 code already requires some hacks (bumping
Switching to javac 17 would drop support for Java 6:
Switching to javac 21 would drop support for Java 7:
So switching to Java 17 could be a bit painful for those that are still stuck at Java 6. In our case I think applying the same hack (compiling all Java 5 and 6 code a second time with |
Thank you to everyone who has provided feedback so far! I reviewed some of the input provided on the timeline for this:
It looks like Quarkus 3.7 will use Java 17 as the minimum JDK: https://quarkus.io/blog/java-17/
@lazaroclapp are you able to provide any updates on that migration? |
We (Uber) have recently finished the migration of the build system from buck to bazel and some initial JDK 17 support is being rolled out. However, the mass migration will probably still take some time and likely won't finish before the end of this half. |
We at Trino project (https://github.com/trinodb/trino) rely on error-prone for static code analysis. |
As a general update here, I'm expecting Error Prone will not support running on JDK 11 after September 2024. (As before using Error Prone to compile code that is deployed to earlier versions will still be fully supported, it will just require using a newer JDK for compilation and setting
Thanks, that's something I expect to provide as well and is somewhat separate, we want Error Prone to be compatible with the latest available JDK versions and Java language features regardless of what the minimum supported JDK version is. A related point about Java language syntax is that raising the minimum supported JDK removes support for some older Java language versions, |
Error Prone 2.32.0 has been released, which raises the minimum supported JDK version to JDK 17: https://github.com/google/error-prone/releases/tag/v2.32.0 |
Would be good to document the new requirement, i.e #4570 |
The min JDK version for OSS is being updated to 17 as part of: #3803 PiperOrigin-RevId: 673443508
The min JDK version for OSS is being updated to 17 as part of: #3803 PiperOrigin-RevId: 673919944
Error Prone will eventually drop support for running on JDK 11. This bug is intended to collect input from the community on the timing of that decision. There aren't immediate plans to do this, but there are also reason to look forward to using Java > 11 language features in the implementation.
Note that using a newer JDK version to run javac during the build doesn't prevent building code that is deployed to earlier versions, the compiler just has to be configured with
--release
(or-source
/-target
/-bootclasspath
). For example, it's supported to use the JDK 17 javac and pass--release 8
to compile Java 8 code that is deployed to a JDK 8 runtime.Questions:
What would the next minimum supported version be? (I think a likely answer is 17, since it's the next LTS after 11.)
If you're currently running Error Prone on JDK 11, do you have a timeline for upgrading to a newer version?
The text was updated successfully, but these errors were encountered: