You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JDT now supports native compilation of Multi-Release JARs.
41
+
[Multi-Release JARs](https://openjdk.org/jeps/238) are a feature introduced in Java 9 that allows a single JAR file to contain multiple versions of the same class,
42
+
each compiled for a specific Java release.
43
+
This enables libraries to take advantage of newer Java features while maintaining backward compatibility with older Java versions.
44
+
45
+
With this new feature, you can now compile Multi-Release Types directly within Eclipse.
46
+
Multi-Release Types are classes that exist in different variants with the same name across different source folders,
47
+
where each variant is automatically compiled with the appropriate Java release settings and placed in the correct output folder.
48
+
49
+
This implementation follows the "Pattern 3: Single Project" approach described in the [Maven Compiler Plugin documentation](https://maven.apache.org/plugins/maven-compiler-plugin/multirelease.html).
50
+
Previously, this pattern had limited IDE support, but Eclipse now provides a simple and elegant solution by compiling individual class files with the corresponding release option.
51
+
52
+
To enable Multi-Release compilation for a source folder, open the source folder properties in the Build Path configuration and specify the target Java release:
53
+
54
+

55
+
56
+
Once configured, you can:
57
+
- Edit and compile Multi-Release Types simultaneously across different Java versions
58
+
- Run Multi-Release compiled projects directly from the Eclipse IDE
59
+
- Use m2eclipse's built-in support to automatically map `maven-compiler-plugin` executions for Multi-Release JARs into JDT configuration
60
+
61
+
This feature significantly simplifies the development workflow for libraries that need to support multiple Java versions.
62
+
We welcome your feedback and testing of this new capability.
63
+
For known issues and to report problems, please visit the [JDT Core issue tracker](https://github.com/eclipse-jdt/eclipse.jdt.core/issues/4275).
64
+
65
+
For more details on m2eclipse integration, see the [m2e-core release notes](https://github.com/eclipse-m2e/m2e-core/blob/main/RELEASE_NOTES.md#multi-release-jar-support).
0 commit comments