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
- Set JAVA_HOME to a full JDK and restart dev mode.
- Use a JDK-based container image (e.g. eclipse-temurin:17-jdk instead of ...-jre).
- 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
- Use -jdk based container images for dev mode.
- Verify javac is on PATH in CI runners.
- Pin JAVA_HOME to a JDK in your shell profile and IDE configs.
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
- Quarkus applications require Java 21 or higher to build
- Failed to create compiler
- Failed to open class path file <file>
- Failed to redefine module ${moduleName}
- Failed to acquire handle to Module#implAddOpens. This must b
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/964faa513137caa2.
Report an issue: GitHub.