quarkusio/quarkus · error · RuntimeException

Failed to load quarkus.properties

Error message

Failed to load quarkus.properties

What it means

In clientVersion(), once quarkus.properties is found, its contents are loaded; an IOException while reading (file/jar protocol path or the generic getResourceAsStream branch) is wrapped in a RuntimeException 'Failed to load quarkus.properties'. This signals the version metadata exists but is unreadable/corrupt.

Source

Thrown at devtools/cli-common/src/main/java/io/quarkus/cli/common/VersionHelper.java:34

    public static String clientVersion() {
        if (version != null) {
            return version;
        }

        final Properties props = new Properties();
        final URL quarkusPropertiesUrl = Thread.currentThread().getContextClassLoader().getResource("quarkus.properties");
        if (quarkusPropertiesUrl == null) {
            throw new RuntimeException("Failed to locate quarkus.properties on the classpath");
        }

        // we have a special case for file and jar as using getResourceAsStream() on Windows might cause file locks
        if ("file".equals(quarkusPropertiesUrl.getProtocol()) || "jar".equals(quarkusPropertiesUrl.getProtocol())) {
            ClassPathUtils.consumeAsPath(quarkusPropertiesUrl, p -> {
                try (BufferedReader reader = Files.newBufferedReader(p)) {
                    props.load(reader);
                } catch (IOException e) {
                    throw new RuntimeException("Failed to load quarkus.properties", e);
                }
            });
        } else {
            try {
                props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("quarkus.properties"));
            } catch (IOException e) {
                throw new IllegalStateException("Failed to load quarkus.properties", e);
            }
        }

        version = props.getProperty("quarkus-core-version");
        if (version == null) {
            throw new RuntimeException("Failed to locate quarkus-core-version property in the bundled quarkus.properties");
        }

        return version;
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Reinstall/refresh the Quarkus CLI to replace the corrupt or locked resource.
  2. Close processes locking the jar (antivirus, editors) and retry, especially on Windows.
  3. Verify filesystem permissions on the CLI installation directory and jar.

Example fix

// before (locked/corrupt install)
C:\Users\me\.quarkus\cli\quarkus-cli.jar  // unreadable entry
// after: reinstall
jbang app install --fresh quarkus@quarkusio
Defensive patterns

Strategy: try-catch

Validate before calling

try (InputStream in = Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("quarkus.properties")) {
    if (in == null || in.read() == -1) {
        throw new IllegalStateException("quarkus.properties unreadable or empty");
    }
}

Try / catch

try {
    String v = VersionHelper.clientVersion();
} catch (RuntimeException e) {
    if (e.getCause() instanceof IOException) {
        log.warn("quarkus.properties unreadable (locked/corrupt); reinstalling recommended");
    } else throw e;
}

Prevention

When it happens

Trigger: quarkus.properties exists on the classpath but reading it throws IOException — e.g. file locked or unreadable on disk (Windows file-lock is why the file/jar special case exists), truncated jar entry, permission denied, or getResourceAsStream returning a stream that fails mid-load.

Common situations: Antivirus or another process locking the CLI jar on Windows; running from a network drive with flaky access; a corrupted local CLI installation; jar partially downloaded.

Related errors


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