The j2objc project uses Java 11 as a minimum for its build. There have been several Java language improvements since Java 11, such as records, switch expressions, instanceof pattern matching, and text blocks. Most of these are supported in j2objc now, just set JAVA_HOME to point to a JDK that supports the features you use.
Since j2objc's front-end is javac, some of this support has hacks so it works on older versions (mostly in
TreeConverter), and is blocking pattern matching for switch expressions and statements, introduced in Java 21.
It's been almost two years since Java 21 was released, so does anyone have a reason why j2objc can't require Java 21? If your project has source files that can't be compiled with Java 21, like javac the j2objc translator has a `-source` flag that allows projects to specify an older Java version during compilation.