{"record":{"id":"7bb5be1b55f33422","repo":"quarkusio/quarkus","slug":"unsupported-os-please-use-maven-plugin-instead-to","errorCode":null,"errorMessage":"Unsupported OS, please use maven plugin instead to generate Java classes from proto files","messagePattern":"Unsupported OS, please use maven plugin instead to generate Java classes from proto files","errorType":"exception","errorClass":"CodeGenException","httpStatus":null,"severity":"error","filePath":"extensions/grpc/codegen/src/main/java/io/quarkus/grpc/codegen/GrpcCodeGen.java","lineNumber":548,"sourceCode":"\n        for (ResolvedDependency artifact : model.getDependencies()) {\n            if (groupId.equals(artifact.getGroupId())\n                    && artifactId.equals(artifact.getArtifactId())\n                    && classifier.equals(artifact.getClassifier())\n                    && packaging.equals(artifact.getType())) {\n                artifactPath = artifact.getResolvedPaths().getSinglePath();\n            }\n        }\n        return artifactPath;\n    }\n\n    private String osClassifier() throws CodeGenException {\n        String architecture = getArchitecture();\n        return switch (OS.current()) {\n            case LINUX -> \"linux-\" + architecture;\n            case WINDOWS -> \"windows-\" + architecture;\n            case MAC -> \"osx-\" + architecture;\n            default -> throw new CodeGenException(\n                    \"Unsupported OS, please use maven plugin instead to generate Java classes from proto files\");\n        };\n    }\n\n    /**\n     * {@return the bespoke architecture string, or {@code null} if unknown}\n     */\n    private static String getArchitecture() {\n        return switch (CPU.host()) {\n            case x64 -> \"x86_64\";\n            case x86 -> \"x86_32\";\n            case arm -> \"arm_32\";\n            case aarch64 -> \"aarch_64\";\n            case mips -> \"mips_32\";\n            case mipsel -> \"mipsel_32\";\n            case mips64 -> \"mips_64\";\n            case mips64el -> \"mipsel_64\";\n            case ppc32 -> \"ppc_32\";","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/grpc/codegen/src/main/java/io/quarkus/grpc/codegen/GrpcCodeGen.java#L530-L566","documentation":"Quarkus derives the protoc OS classifier from smallrye-common OS/CPU detection. If the current OS is not LINUX, WINDOWS, or MAC (e.g. Solaris, AIX, FreeBSD, or an unknown os.name), osClassifier() throws this CodeGenException because no prebuilt protoc binaries exist for it.","triggerScenarios":"Running Quarkus gRPC code generation on an unsupported OS, or in an environment where os.name is unrecognized (unusual JVM/OS combos, exotic containers), so the switch over OS.current() hits the default branch.","commonSituations":"Building on FreeBSD/Solaris/IBM i; using a container image with a modified os.name; running on z/OS or other mainframe JVMs; security-hardened JVMs that strip os properties.","solutions":["Build on a supported OS (Linux, macOS, Windows) or in a Linux container (e.g. via Docker) instead of the host OS","Generate the Java classes from proto files with the protobuf-maven-plugin (protobuf grpc) as the message suggests, then let Quarkus consume them","Generate code in a CI step on Linux and commit/check in the generated sources for unsupported local environments"],"exampleFix":"// before: building directly on unsupported OS\n./mvnw clean install\n// after: generate protoc classes via the maven plugin or on Linux\nmvn protobuf:compile protobuf:compile-custom  # or build in a linux docker container","handlingStrategy":"fallback","validationCode":"String os = System.getProperty(\"os.name\", \"\").toLowerCase();\nboolean supported = os.contains(\"linux\") || os.contains(\"windows\") || os.contains(\"mac\");\nif (!supported) {\n    System.out.println(\"Unsupported OS for Quarkus gRPC codegen; generate protos with protobuf-maven-plugin or in a Linux container\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    build.run();\n} catch (CodeGenException e) {\n    if (e.getMessage().contains(\"Unsupported OS\")) {\n        // fallback: run codegen in a Linux container and reuse generated sources\n        exec(\"docker run -v $PWD:/ws -w /ws maven:3-eclipse-temurin mvn generate-sources\");\n    }\n}","preventionTips":["Develop and build on Linux/macOS/Windows only; use Linux containers for other platforms","Pre-generate proto classes on a supported platform and commit them for exotic OSes","Use protobuf-maven-plugin on unsupported hosts as the message suggests","Check `java -XshowSettings:properties` os.name if you believe your OS is supported"],"tags":["grpc","codegen","os-compatibility","protoc"],"backgroundTag":"unsupported-platform","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}