Because life is too short to wait for your users to upgrade their Java!
Independent fork of bsideup/jabel (Apache 2.0), published under the
net.morphismmcnamespace.
- Write Java 9–25 syntax, run on Java 8: Compiles modern language features down to strict Java 8 (
v52) classfiles. - Zero runtime dependencies: No shaded runtime library or agent is needed on your application's classpath.
--release 8API safety: Java 9+ standard library APIs (such asList.of()orString.isBlank()) are still caught at compile time so artifacts remain safe on Java 8.
- Build JDK: JDK 17, 21, or 25
- Runtime JRE: Java 8 or newer
- Java 9–16:
var, switch expressions, text blocks,instanceofpattern matching, private interface methods, records (no@Desugarneeded), diamond anonymous classes, effectively final try-with-resources,@SafeVarargson private methods, local enums / static inner members - Java 17: Sealed classes and interfaces
- Java 21: Pattern matching for
switch, record patterns, guardedwhenclauses - Java 22: Unnamed variables and patterns (
_) - Java 25: Primitive patterns in
instanceof/switch, flexible constructor bodies (statements beforesuper(...)/this(...)), compact source files & instancemain
See Supported Language Features for the full feature list and module IDs.
Add the MorphismMC Maven repository in settings.gradle.kts:
pluginManagement {
repositories {
maven("https://repo.morphismmc.net/releases")
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositories {
maven("https://repo.morphismmc.net/releases")
mavenCentral()
}
}Apply the Jabel plugin in build.gradle.kts with a JDK 17, 21, or 25 toolchain:
plugins {
java
id("net.morphismmc.jabel") version "2.0.0-SNAPSHOT"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21) // or 17 / 25
}
}
jabel {
// Optional configuration — see docs/configuration.md
}The Gradle plugin automatically enables options.fork, injects the required --add-opens flags, sets options.release = 8, synchronizes IntelliJ IDEA / Eclipse source levels, and wires jabel-javac-plugin.
Add the MorphismMC Maven repository and register jabel-maven-plugin as an extension (<extensions>true</extensions>):
<pluginRepositories>
<pluginRepository>
<id>morphismmc</id>
<url>https://repo.morphismmc.net/releases</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>morphismmc</id>
<url>https://repo.morphismmc.net/releases</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>net.morphismmc</groupId>
<artifactId>jabel-maven-plugin</artifactId>
<version>2.0.0-SNAPSHOT</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>For full Gradle/Maven options, manual maven-compiler-plugin configuration, and raw javac / -Xplugin:jabel usage, see the Configuration Reference.
jabel-gradle-plugin automatically configures IntelliJ IDEA (idea.module / idea.project) and Eclipse (eclipse.jdt, when the eclipse plugin is applied) so your editor uses the toolchain's source language level while keeping target bytecode at Java 8 (1.8). Set jabel { configureIde = false } to opt out.
When targeting --release 8, the compiler rejects Java 9+ standard library APIs. To get matching editor warnings in IntelliJ IDEA:
- Open Configure inspections on the language level / API usage inspection
- Find Usages of API which isn't available at the configured language level
- Set Higher than to 8 - Lambdas, type annotations etc.
- Supported Language Features — feature matrix, module IDs, and
--release 8behavior - Configuration Reference — Gradle, Maven, manual
maven-compiler-plugin, and rawjavacoptions - Architecture & Contributor Guide — v2 pipeline design, repository modules, and verification matrix
