{"record":{"id":"5f286d6605cbd962","repo":"JetBrains/intellij-community","slug":"unsupported-class-version-error","errorCode":null,"errorMessage":"Unsupported class version error: ","messagePattern":"Unsupported class version error: ","errorType":"validation","errorClass":"CodeGenerationException","httpStatus":null,"severity":"error","filePath":"java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java","lineNumber":247,"sourceCode":"  }\n\n  static void pushPropValue(GeneratorAdapter generator, String propertyClass, Object value) {\n    PropertyCodeGenerator codeGen = myPropertyCodeGenerators.get(propertyClass);\n    if (codeGen == null) {\n      throw new RuntimeException(\"Unknown property class \" + propertyClass);\n    }\n    codeGen.generatePushValue(generator, value);\n  }\n\n  static InstrumentationClassFinder.PseudoClass getComponentClass(String className, final InstrumentationClassFinder finder) throws CodeGenerationException {\n    try {\n      return finder.loadClass(className);\n    }\n    catch (ClassNotFoundException e) {\n      throw new CodeGenerationException(null, \"Class not found: \" + className);\n    }\n    catch(UnsupportedClassVersionError e) {\n      throw new CodeGenerationException(null, \"Unsupported class version error: \" + className);\n    }\n    catch (IOException e) {\n      throw new CodeGenerationException(null, e.getMessage(), e);\n    }\n  }\n\n  public static Type typeFromClassName(final String className) {\n    return Type.getType(\"L\" + className.replace('.', '/') + \";\");\n  }\n\n  class FormClassVisitor extends ClassVisitor implements GetFontMethodProvider {\n    private String myClassName;\n    private String mySuperName;\n    private final Map<String, String> myFieldDescMap = new HashMap<>();\n    private final Map<String, Integer> myFieldAccessMap = new HashMap<>();\n    private boolean myHaveCreateComponentsMethod = false;\n    private int myCreateComponentsAccess;\n    private final boolean myExplicitSetupCall;","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java#L229-L265","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"int major = readClassFileMajorVersion(dependencyJarEntry); // reject if > runtime JDK's supported version before building","typeGuard":null,"tryCatchPattern":"catch (CodeGenerationException e) if message starts with 'Unsupported class version error': identify the JAR/class, then align JDK target or upgrade the runtime","preventionTips":["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"],"tags":["gui-designer","forms","classloading","jdk-version","build","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}