JetBrains/intellij-community · error · CodeGenerationException
Unsupported class version error:
Error message
Unsupported class version error:
What it means
getComponentClass catches UnsupportedClassVersionError and rethrows CodeGenerationException('Unsupported class version error: ' + className). A class was found on the instrumentation classpath but its bytecode version is newer than the JVM/classpath context performing forms compilation can accept.
Source
Thrown at java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java:247
}
static void pushPropValue(GeneratorAdapter generator, String propertyClass, Object value) {
PropertyCodeGenerator codeGen = myPropertyCodeGenerators.get(propertyClass);
if (codeGen == null) {
throw new RuntimeException("Unknown property class " + propertyClass);
}
codeGen.generatePushValue(generator, value);
}
static InstrumentationClassFinder.PseudoClass getComponentClass(String className, final InstrumentationClassFinder finder) throws CodeGenerationException {
try {
return finder.loadClass(className);
}
catch (ClassNotFoundException e) {
throw new CodeGenerationException(null, "Class not found: " + className);
}
catch(UnsupportedClassVersionError e) {
throw new CodeGenerationException(null, "Unsupported class version error: " + className);
}
catch (IOException e) {
throw new CodeGenerationException(null, e.getMessage(), e);
}
}
public static Type typeFromClassName(final String className) {
return Type.getType("L" + className.replace('.', '/') + ";");
}
class FormClassVisitor extends ClassVisitor implements GetFontMethodProvider {
private String myClassName;
private String mySuperName;
private final Map<String, String> myFieldDescMap = new HashMap<>();
private final Map<String, Integer> myFieldAccessMap = new HashMap<>();
private boolean myHaveCreateComponentsMethod = false;
private int myCreateComponentsAccess;
private final boolean myExplicitSetupCall;View on GitHub (pinned to be881553f2)
Solutions
- Align bytecode versions: build dependencies with a target <= the JDK used for forms compilation/instrumentation
- Upgrade the runtime/IDE JDK to one that understands the dependency's class file version
- Downgrade the dependency to a version compatible with your toolchain
- Check Module SDK and Project bytecode target settings for mismatches
Defensive patterns
Strategy: try-catch
Validate before calling
int major = readClassFileMajorVersion(dependencyJarEntry); // reject if > runtime JDK's supported version before building
Try / catch
catch (CodeGenerationException e) if message starts with 'Unsupported class version error': identify the JAR/class, then align JDK target or upgrade the runtime
Prevention
- Keep the Module SDK >= the bytecode level of every dependency used in forms
- Pin dependency versions whose class files your build JDK can read
- Watch for 'class file has wrong version' warnings during dependency upgrades
When it happens
Trigger: A dependency JAR containing the form's component class was compiled with a newer JDK target (e.g. class file 65 from JDK 21) while the build/instrumentation runs on an older JDK or older ASM-aware pipeline.
Common situations: Upgrading a library that ships Java-21 bytecode while the IDE/module still compiles on JDK 17; mixed toolchains where dependencies are built by a newer CI JDK; setting --release lower than a dependency's bytecode; running an older IDE version with newer project bytecode.
Related errors
- Class not found:
- Attempt to compile nested form with no nested form loader sp
- No binding on root component of nested form
- Recursive form nesting is not allowed
- Invalid input: {input}
AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14).
Data as JSON: /api/errors/5f286d6605cbd962.
Report an issue: GitHub.