Mps logo

MPS

Language workbench to create Domain-Specific Languages

JDK update in MPS 2022.2

MPS 2022.2 came with a major change in the Java Development Kit version. It now supports JDK 17, while the previous versions supported and ran on JDK 11. This change may or may not impact your projects, so we decided to cover the areas that could be affected.

The platform update

The JDK change originated in the underlying IntelliJ platform that MPS builds on. The IntelliJ IDEA team listed the benefits of this change in one of their recent blog posts.

In short, JetBrains Runtime 17 (JBR 17) brings significant IDE performance improvements, better security, enhanced rendering performance on macOS thanks to the Metal API, and more.

The project bytecode version

Projects in MPS can define their “Project bytecode version”:

Unless a specific version is selected in your project, the “JDK Default” value now is JDK 17 instead of JDK 11. The project JDK will be changed as soon as you open the project in MPS 2022.2. This change is not likely to affect your project, however.

IDEA plugins with MPS

When building plugins for MPS or IntelliJ IDEA, make sure the Project bytecode version is set to version 17 or earlier, as IDEA will not run plugins compiled with newer versions of the JDK.

Using MPS plugins in IDEA

IntelliJ IDEA projects that use MPS plugins must have the Project JDK in IntelliJ IDEA set to version 11 or newer.

Standalone IDE applications

Standalone applications based on MPS have to be run on JDK 17. You might be able to run them on JDK 11, but this option is not supported.

MPS compilation

MPS itself is compiled using JDK 11. This may be an important piece of information for projects that embed pieces of MPS code. In these cases it is important to know that certain MPS runtime solutions do not need to be re-compiled.

Solve issues with Java reflection

There may be some problems with the visibility of different classes that your code accesses using Java reflection API. You can solve the issues in the same way we did for the JDK classes when running MPS – use the –add-opens JVM argument to add the respective packages. Check out the user guide for more details:

If you encounter any problems, please report them to our issue tracker.

The JetBrains MPS team

image description