-
Notifications
You must be signed in to change notification settings - Fork 369
Switching to Java 17
Picard now requires Java 17 to both build and run, so you’ll need to install a version 17 JDK. I’d recommend using “homebrew” to install JDKs on Macs, and jenv to manage Java versions on the command line. jenv is especially handy if you need to switch between projects that use different versions of Java.
We have tested Picard with the Adoptium JDK known as temurin. To install temurin with brew, do:
brew tap homebrew/cask-versions
brew install --cask temurin17
There are several settings in IntelliJ where you may need to make changes.
Go to File/Project Structure. Make sure the "SDKs" section includes your version 17 JDK:
Then choose “Project” under “Project Settings”. You’ll need to update both “SDK” (point to your local Java 17 JDK), and “Language Level” (choose "17 - Sealed types, always strict floating point semantics"):
Go to Preferences/Build, Execution, Deployment/Compiler/Java Compiler:
Set the "project bytecode version" to 17.
Go to Preferences/Build, Execution, Deployment/Build Tools/Gradle. Update the “Gradle JVM” to use a Java 17 JVM. If you don’t do this, you may get errors when refreshing build.gradle.
Make sure to refresh gradle in the gradle tab after making these changes.