The JDK 25 compiler
Modern syntax and the method-body source format.
Language features
SkJvm 2.0.0 uses the JDK compiler instead of Janino. Lambdas, method references, var, local classes, text blocks and Java 25 switch expressions are supported. Preview features are disabled; annotation processors are disabled too.
var values = List.of("one", "two");
List<String> upper = values.stream().map(String::toUpperCase).toList();
sender.sendMessage(String.join(", ", upper));
Source format
Source is inserted into a method body. import and package declarations do not belong there; see predeclared imports. Use fully qualified names for other types.
Compilation and policy are separate
Valid Java may fail bytecode checks: System::exit, for example, is valid language syntax but rejected by policy.
Inline .sk syntax also depends on Skript’s node and indentation parser. Move awkward fragments to .jv files. The old Janino limitations no longer apply; the article’s former URL is retained for existing links.