running Intellij with Jdk17 and Metal UI
Inspired by this blog post I just want to create my own write up to find it faster in the future.
Jetbrain’s OpenJDK build can be downloaded from here. Careful, they publish JDK 11 and JDK 17 builds! Unzip the JDK to any location. You might have to run xattr -rd com.apple.quarantine <DIRECTORY>
to remove quarantine.
Next, change Intellij’s vm options. This can be done from the Jetbrains Toolbox menu:
add the following entries:
--illegal-access=warn
-Dsun.java2d.metal=true
--add-opens=java.desktop/java.awt.event=ALL-UNNAMED
--add-opens=java.desktop/sun.font=ALL-UNNAMED
--add-opens=java.desktop/java.awt=ALL-UNNAMED
--add-opens=java.desktop/sun.awt=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.desktop/javax.swing=ALL-UNNAMED
--add-opens=java.desktop/sun.swing=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED
--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED
--add-exports=java.desktop/sun.font=ALL-UNNAMED
--add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED
--add-exports=java.desktop/com.apple.laf=ALL-UNNAMED
--add-exports=java.desktop/com.apple.eawt.event=ALL-UNNAMED
Last but not least, open any IntelliJ project, hit Shift
twice to open the search dialog and look for Choose Boot Java Runtime for the IDE
. Chose New -> Add custom Runtime and select the directory where you unzipped the Jetbrains JDK. You will then be prompted to restart your IDE. The End.
Jetbrains Youtrack: Improve java2d rendering performance on macOS by using Metal framework