{"record":{"id":"396907588d459eb4","repo":"quarkusio/quarkus","slug":"unable-to-determine-launch-jar-path","errorCode":null,"errorMessage":"Unable to determine launch jar path","messagePattern":"Unable to determine launch jar path","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/AotQuarkusEntryPoint.java","lineNumber":45,"sourceCode":"        System.setProperty(\"java.util.concurrent.ForkJoinPool.common.threadFactory\",\n                \"io.quarkus.bootstrap.forkjoin.QuarkusForkJoinWorkerThreadFactory\");\n        Timing.staticInitStarted(false);\n\n        try {\n            doRun(args);\n        } catch (RuntimeException | Error e) {\n            InitialConfigurator.DELAYED_HANDLER.close();\n            throw e;\n        } catch (Throwable t) {\n            InitialConfigurator.DELAYED_HANDLER.close();\n            throw new UndeclaredThrowableException(t);\n        }\n    }\n\n    private static void doRun(String... args) throws Throwable {\n        Path jarPath = QuarkusEntryPoint.resolveJarPath(AotQuarkusEntryPoint.class);\n        if (jarPath == null) {\n            throw new IllegalStateException(\"Unable to determine launch jar path\");\n        }\n        Path appRoot = jarPath.getParent().getParent().getParent();\n\n        // Load cached resources and main class name\n        AotSerializedApplication app;\n        Path cacheFile = appRoot.resolve(QUARKUS_APPLICATION_DAT);\n        if (Files.isReadable(cacheFile)) {\n            try (InputStream in = new BufferedInputStream(Files.newInputStream(cacheFile), 8192)) {\n                app = AotSerializedApplication.read(in);\n            }\n        } else {\n            throw new IllegalStateException(\"Serialized application file not found or not readable: \" + cacheFile\n                    + \". The application may not have been packaged correctly with aot-jar type.\");\n        }\n\n        final AotRunnerClassLoader aotRunnerClassLoader = app.getRunnerClassLoader();\n        try {\n            Thread.currentThread().setContextClassLoader(aotRunnerClassLoader);","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/AotQuarkusEntryPoint.java#L27-L63","documentation":"AotQuarkusEntryPoint.doRun() launches an AOT-packaged Quarkus application. It determines the location of the runner jar via QuarkusEntryPoint.resolveJarPath(AotQuarkusEntryPoint.class); if the protection domain/code source yields null it cannot locate the launch jar and throws IllegalStateException. This indicates the entry point is not running from a jar as expected.","triggerScenarios":"Running the AOT entry point (java -cp ... io.quarkus.bootstrap.runner.AotQuarkusEntryPoint) from a classes directory, shaded/unusual jar layout, or a custom launcher where resolveJarPath() returns null instead of a jar path.","commonSituations":"Launching the AOT application with a hand-written classpath instead of the generated runner jar, running from an IDE with exploded classes, or repackaging the runner jar in a way that breaks code-source resolution.","solutions":["Launch the application with the generated Quarkus runner jar (java -jar target/quarkus-app/quarkus-run.jar) rather than a custom classpath.","Rebuild the package with the aot-jar packaging type (mvn package) so the runner layout is correct.","Do not run AotQuarkusEntryPoint from exploded target/classes in an IDE; use the packaged artifact."],"exampleFix":"// before\njava -cp target/classes:libs/* io.quarkus.bootstrap.runner.AotQuarkusEntryPoint\n\n// after\njava -jar target/quarkus-app/quarkus-run.jar","handlingStrategy":"validation","validationCode":"Path runner = Paths.get(System.getProperty(\"java.class.path\").split(File.pathSeparator)[0]);\nif (!runner.toString().endsWith(\".jar\")) {\n    throw new IllegalStateException(\"Launch with the Quarkus runner jar, not exploded classes\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    AotQuarkusEntryPoint.main(args);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"Unable to determine launch jar path\")) {\n        System.err.println(\"Run via: java -jar target/quarkus-app/quarkus-run.jar\");\n    } else throw e;\n}","preventionTips":["Always launch with the generated quarkus-run.jar.","Do not run AotQuarkusEntryPoint from IDE exploded classpaths.","Validate packaging output after mvn package."],"tags":["startup","aot","packaging"],"backgroundTag":"missing-launch-jar","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}