quarkusio/quarkus · error · RuntimeException

No system java compiler provided

Error message

No system java compiler provided

What it means

JavaCompilationProvider.compile() uses the javax.tools JavaCompiler obtained from the system ToolProvider. When the running JVM does not provide a system Java compiler (this.compiler == null), it throws a RuntimeException with 'No system java compiler provided'. This happens when Quarkus runs on a JRE rather than a JDK.

Source

Thrown at core/deployment/src/main/java/io/quarkus/deployment/dev/JavaCompilationProvider.java:65

        return Set.of(".java");
    }

    @Override
    public void compile(Set<File> filesToCompile, CompilationProvider.Context context) {
        if (this.compiler == null) {
            this.compiler = ToolProvider.getSystemJavaCompiler();
            this.compilerFlags = new CompilerFlags(COMPILER_OPTIONS,
                    context.getCompilerOptions(PROVIDER_KEY),
                    context.getReleaseJavaVersion(),
                    context.getSourceJavaVersion(),
                    context.getTargetJvmVersion(),
                    context.getAnnotationProcessors()).toList();
        }

        final JavaCompiler compiler = this.compiler;

        if (compiler == null) {
            throw new RuntimeException("No system java compiler provided");
        }

        final QuarkusFileManager.Context sourcesContext = new QuarkusFileManager.Context(
                context.getClasspath(), context.getReloadableClasspath(),
                context.getOutputDirectory(), context.getGeneratedSourcesDirectory(),
                context.getAnnotationProcessorPaths(),
                context.getSourceEncoding(),
                context.ignoreModuleInfo());

        if (this.fileManager == null) {
            final Supplier<StandardJavaFileManager> supplier = () -> {
                final Charset charset = context.getSourceEncoding();
                return compiler.getStandardFileManager(null, null, charset);
            };

            if (context.getReloadableClasspath().isEmpty()) {
                this.fileManager = new StaticFileManager(supplier, sourcesContext);
            } else {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Set JAVA_HOME to a full JDK and restart dev mode.
  2. Use a JDK-based container image (e.g. eclipse-temurin:17-jdk instead of ...-jre).
  3. Verify with 'java -version' / 'javac -version' that javac is available in the same JVM.

Example fix

// before
FROM eclipse-temurin:17-jre

// after
FROM eclipse-temurin:17-jdk
Defensive patterns

Strategy: validation

Validate before calling

if (javax.tools.ToolProvider.getSystemJavaCompiler() == null) {
    throw new IllegalStateException("JAVA_HOME must point to a JDK, not a JRE");
}

Prevention

When it happens

Trigger: Invoking live reload / runtime compilation while the JVM lacks javax.tools.JavaCompiler, i.e. JAVA_HOME points to a JRE or a JDK image compiled without the jdk.compiler module.

Common situations: Docker images based on JRE-only distributions; CI runners configured with a JRE; IDE run configurations using a JRE runtime.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/964faa513137caa2. Report an issue: GitHub.