apache/flink · error · FlinkException

No JAR found on classpath. Please provide a JAR explicitly.

Error message

No JAR found on classpath. Please provide a JAR explicitly.

What it means

Error "No JAR found on classpath. Please provide a JAR explicitly." thrown in apache/flink.

Source

Thrown at flink-clients/src/main/java/org/apache/flink/client/deployment/application/FromClasspathEntryClassInformationProvider.java:164

        return extractJobClassNameFromFileClasspath(extractSystemClasspath());
    }

    private static String extractJobClassFromUrlClasspath(Iterable<URL> classpath)
            throws IOException, FlinkException {
        final List<File> jarFilesFromClasspath =
                StreamSupport.stream(classpath.spliterator(), false)
                        .map(url -> new File(url.getFile()))
                        .filter(f -> isJarFilename(f.getName()))
                        .collect(Collectors.toList());
        return extractJobClassNameFromFileClasspath(jarFilesFromClasspath);
    }

    private static String extractJobClassNameFromFileClasspath(Iterable<File> classpath)
            throws FlinkException, IOException {
        try {
            return JarManifestParser.findOnlyEntryClass(classpath).getEntryClass();
        } catch (NoSuchElementException e) {
            throw new FlinkException(
                    "No JAR found on classpath. Please provide a JAR explicitly.", e);
        } catch (IllegalArgumentException e) {
            throw new FlinkException(
                    "Multiple JAR archives with entry classes found on classpath. Please provide an entry class name.",
                    e);
        }
    }

    private static boolean isJarFilename(String filename) {
        return filename.endsWith(".jar");
    }
}

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Address the cause reported by the error message: No JAR found on classpath. Please provide a JAR explicitly.
  2. Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry.

Example fix

Correct the condition described ("No JAR found on classpath. Please provide a JAR explicitly.") and rerun the job or command.

When it happens

Trigger: Triggered at runtime when the operation fails because: No JAR found on classpath. Please provide a JAR explicitly.

Common situations: Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: No JAR found on classpath. Please provide a JAR explicitly.


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/371eb6a6d22a91bf. Report an issue: GitHub.