{"record":{"id":"4e593ae40a3df883","repo":"eclipse-vertx/vert.x","slug":"unable-to-detect-java-compiler-make-sure-you-re-u","errorCode":null,"errorMessage":"Unable to detect java compiler, make sure you're using a JDK not a JRE!","messagePattern":"Unable to detect java compiler, make sure you're using a JDK not a JRE!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/impl/verticle/CompilingClassLoader.java","lineNumber":61,"sourceCode":"  public CompilingClassLoader(ClassLoader loader, String sourceName) {\n    super(loader);\n    URL resource = getResource(sourceName);\n    if (resource == null) {\n      throw new RuntimeException(\"Resource not found: \" + sourceName);\n    }\n    //Need to urldecode it too, since bug in JDK URL class which does not url decode it, so if it contains spaces you are screwed\n    final File sourceFile = new File(decodeURIComponent(resource.getFile(), false));\n    if (!sourceFile.canRead()) {\n      throw new RuntimeException(\"File not found: \" + sourceFile.getAbsolutePath() + \" current dir is: \" + new File(\".\").getAbsolutePath());\n    }\n\n    this.javaSourceContext = new JavaSourceContext(sourceFile);\n\n    try {\n      DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();\n      JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler();\n      if (javaCompiler == null) {\n        throw new RuntimeException(\"Unable to detect java compiler, make sure you're using a JDK not a JRE!\");\n      }\n      StandardJavaFileManager standardFileManager = javaCompiler.getStandardFileManager(null, null, null);\n\n      standardFileManager.setLocation(StandardLocation.SOURCE_PATH, Collections.singleton(javaSourceContext.getSourceRoot()));\n      fileManager = new MemoryFileManager(loader, standardFileManager);\n\n      // TODO - this needs to be fixed so it can compile classes from the classpath otherwise can't include\n      // other .java resources from other modules\n\n      JavaFileObject javaFile = standardFileManager.getJavaFileForInput(StandardLocation.SOURCE_PATH, resolveMainClassName(), Kind.SOURCE);\n      JavaCompiler.CompilationTask task = javaCompiler.getTask(null, fileManager, diagnostics, null, null, Collections.singleton(javaFile));\n      boolean valid = task.call();\n      if (valid) {\n        for (Diagnostic<?> d : diagnostics.getDiagnostics()) {\n          String code = d.getCode();\n          if (code == null || (!code.startsWith(\"compiler.warn.annotation.method.not.found\") &&\n              !\"compiler.warn.proc.processor.incompatible.source.version\".equals(code))) {\n            log.info(d);","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/impl/verticle/CompilingClassLoader.java#L43-L79","documentation":"Environment capability check in CompilingClassLoader: ToolProvider.getSystemJavaCompiler() returned null, meaning the runtime is a JRE without the javac compiler. Dynamic compilation of .java verticle sources is impossible in this environment.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/impl/verticle/CompilingClassLoader.java:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run on a JDK instead of a JRE","Pre-compile the verticle to bytecode and deploy the compiled class instead"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}