quarkusio/quarkus · error · RuntimeException
Failed to create compiler
Error message
Failed to create compiler
What it means
In IsolatedTestModeMain.setupRuntimeCompilation(), a QuarkusCompiler is constructed from the curated application, the compilation providers, and the dev mode context. If construction fails for any reason (missing toolchain, bad classpath, broken provider), the underlying exception is wrapped in a RuntimeException with message 'Failed to create compiler'.
Source
Thrown at core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedTestModeMain.java:58
private final List<HotReplacementSetup> hotReplacementSetups = new ArrayList<>();
private static volatile CuratedApplication curatedApplication;
private static volatile AugmentAction augmentAction;
private RuntimeUpdatesProcessor setupRuntimeCompilation(DevModeContext context, Path applicationRoot)
throws Exception {
System.setProperty("quarkus.test.display-test-output", "true");
if (!context.getAllModules().isEmpty()) {
ServiceLoader<CompilationProvider> serviceLoader = ServiceLoader.load(CompilationProvider.class);
List<CompilationProvider> compilationProviders = new ArrayList<>();
for (CompilationProvider provider : serviceLoader) {
compilationProviders.add(provider);
context.getAllModules().forEach(moduleInfo -> moduleInfo.addSourcePaths(provider.handledSourcePaths()));
}
QuarkusCompiler compiler;
try {
compiler = new QuarkusCompiler(curatedApplication, compilationProviders, context);
} catch (Exception e) {
throw new RuntimeException("Failed to create compiler", e);
}
TestSupport testSupport = new TestSupport(curatedApplication, compilationProviders, context, DevModeType.TEST_ONLY);
RuntimeUpdatesProcessor processor = new RuntimeUpdatesProcessor(applicationRoot, context, compiler,
DevModeType.TEST_ONLY, this::regenerateApplication,
new BiConsumer<DevModeContext.ModuleInfo, String>() {
@Override
public void accept(DevModeContext.ModuleInfo moduleInfo, String s) {
}
}, new BiFunction<String, byte[], byte[]>() {
@Override
public byte[] apply(String s, byte[] bytes) {
return ClassTransformingBuildStep.transform(s, bytes);
}
}, testSupport, deploymentProblem);
for (HotReplacementSetup service : ServiceLoader.load(HotReplacementSetup.class,
curatedApplication.getOrCreateBaseRuntimeClassLoader())) {
hotReplacementSetups.add(service);View on GitHub (pinned to e1c734241f)
Solutions
- Run Quarkus with a full JDK (JAVA_HOME pointing to a JDK, not a JRE).
- Inspect the 'Caused by' exception for the root cause (e.g. invalid path or missing dependency).
- Fix the module source paths / project directories in the build plugin configuration.
- Clean and rebuild the project to remove stale build outputs.
Example fix
// before JAVA_HOME=/usr/lib/jvm/java-17-jre // after JAVA_HOME=/usr/lib/jvm/java-17-jdk # includes javax.tools JavaCompiler
Defensive patterns
Strategy: validation
Validate before calling
boolean jdkAvailable = javax.tools.ToolProvider.getSystemJavaCompiler() != null;
if (!jdkAvailable) throw new IllegalStateException("Run with a full JDK"); Try / catch
try {
// start test mode
} catch (RuntimeException e) {
if ("Failed to create compiler".equals(e.getMessage())) {
log.error("Root cause:", e.getCause());
}
} Prevention
- Always launch Quarkus dev/test mode with a JDK, not a JRE.
- Validate module source paths in build plugin configuration.
- Read the cause chain immediately instead of guessing.
When it happens
Trigger: Starting Quarkus in continuous-test / test-only dev mode where new QuarkusCompiler(curatedApplication, compilationProviders, context) throws — typically due to invalid source paths or a JDK without the compiler module.
Common situations: Running tests with a JRE instead of a full JDK; malformed quarkus.test.* or module source path configuration in DevModeContext; broken compilation provider plugin.
Related errors
- Failed to open class path file <file>
- Unable to deserialize the dev mode context. Does the Quarkus
- Hot deployment of the application is not supported when upda
- remote-dev can only be used with mutable applications i.e. u
- No system java compiler provided
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/e783345491ce300b.
Report an issue: GitHub.