Skip to content
New issue

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

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

Already on GitHub? # to your account

Upgrading to Java 11 LTS #3

Open
rtyley opened this issue Feb 21, 2024 · 0 comments
Open

Upgrading to Java 11 LTS #3

rtyley opened this issue Feb 21, 2024 · 0 comments
Labels
Java Upgrading Java

Comments

@rtyley
Copy link
Member

rtyley commented Feb 21, 2024

Base assumption: Project is already on Java 8

Overview

  • You may want to complete Upgrading to Scala 2.13 #2 first - although Scala 2.12 supports Java 11, old project dependencies may use bytecode-manipulation libraries that didn't yet support Java 11. Updating to Scala 2.13 will give you a better chance of having up-to-date dependencies that can handle Java 11.
  • Java 11 is the first version of Java optimised for ARM CPU architecture, eg AWS Graviton instances, for better performance & cheaper CPU cost. Java 11 has been a DevX recommendation since 2022.
  • Note that at this point, we would recommend Upgrading to Java 21 LTS #8, rather than Java 11 (tho' if you are on Play 2.8, you may need to upgrade to Java 11 first, as a stepping-stone).

Checklist

  • build.sbt
    • If you're publishing a library and consumers of your library are using Java 11, ensure that scalacOptions includes "-release:11" (even if you build under Java 21!)
    • Watch out for debianPackageDependencies, which may be set to include "openjdk-8-jre-headless" - you'll need to update that to "java11-runtime-headless"
    • Remove obsolete javaOptions, often these relate to RAM or GC (example), eg:
      • RAM (notes)
        • -XX:MaxRAMFraction
        • -XX:InitialRAMFraction
      • Garbage Collection (notes)
        • -XX:+PrintGCDetails
        • -XX:+PrintGCDateStamps
        • -XX:+UseGCLogFileRotation
        • -XX:NumberOfGCLogFiles
        • -XX:GCLogFileSize
  • riff-raff.yaml (if this is a deployable application)
  • .github/workflows/ci.yml
    • Consider using the new guardian/setup-scala action in favour of setup-java & setup-sbt, which moves the place you specify your Java version from java-version into the .tool-versions file to become a source-of-truth for the Java version used by the project (example)

Examples

@rtyley rtyley changed the title Upgrading to Java 11 Upgrading to Java 11 LTS Jun 12, 2024
rtyley added a commit to guardian/tagmanager that referenced this issue Sep 18, 2024
This satisfies one of the updated requirements of Panda v7 - as of
guardian/pan-domain-authentication#150 it
requires Java 11.

See also:

* guardian/maintaining-scala-projects#3
* guardian/maintaining-scala-projects#8
rtyley added a commit to guardian/tagmanager that referenced this issue Sep 18, 2024
This satisfies one of the updated requirements of Panda v7 - as of
guardian/pan-domain-authentication#150 it
requires Java 11.

See also:

* guardian/maintaining-scala-projects#3
* guardian/maintaining-scala-projects#8
rtyley added a commit to guardian/tagmanager that referenced this issue Sep 18, 2024
This satisfies one of the updated requirements of Panda v7 - as of
guardian/pan-domain-authentication#150 it
requires Java 11.

See also:

* guardian/maintaining-scala-projects#3
rtyley added a commit to guardian/tagmanager that referenced this issue Sep 18, 2024
This satisfies one of the updated requirements of Panda v7 - as of
guardian/pan-domain-authentication#150 it
requires Java 11.

See also:

* guardian/maintaining-scala-projects#3
@rtyley rtyley added the Java Upgrading Java label Oct 30, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Java Upgrading Java
Projects
None yet
Development

No branches or pull requests

1 participant