The `jar` command should be available if you have JDK installed,
I think the issue is `ensure-jars-have-correct-contents.sh` does not
respect JAVA_HOME environment variable on searching `jar` command.

Rewriting in Java sounds interesting, will it be faster than shell?

Thanks,
Cheng Pan



> On May 1, 2026, at 10:34, Edward Capriolo <[email protected]> wrote:
> 
> 527.5 [INFO] --- exec:1.3.1:exec (check-jar-contents) @
> hadoop-client-check-invariants ---
> 527.7 ensure-jars-have-correct-contents.sh: line 96: jar: command not found
> 527.7 [ERROR] Listing jar contents for file
> '/build/hadoop/hadoop-client-modules/hadoop-client-api/target/hadoop-client-api-3.6.0-SNAPSHOT.jar'
> failed.
> 
> 
> Not sure, but this is the only thing in the build process that relies on
> the "jar" command...
> 
> Its possible to verify the jar with java you know :)
> 
> public class JarReader { public static void main(String[] args) throws
> IOException { try (JarFile jarFile = new JarFile("example.jar")) {
> Enumeration<JarEntry> entries = jarFile.entries(); while
> (entries.hasMoreElements())
> { JarEntry entry = entries.nextElement(); System.out.println("Entry: " +
> entry.getName()); // Use jarFile.getInputStream(entry) to read the actual
> file data } } } }

Reply via email to