pxb1988/dex2jar · error · HelpException
no jar
Error message
no jar
What it means
Usage guard in JarWeaverCmd.doCommandLine: no positional jar file argument was supplied. The command's syntax is '[options] jar', so with zero remaining args — even if the required -o and -c options were given — it throws this HelpException before opening any file.
Solutions
- Re-run d2j-jar-weaver with the input jar path as the last argument, e.g. d2j-jar-weaver -o out.jar -c config.txt in.jar
- Run with -h to confirm the required options and syntax
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarWeaverCmd.java:23 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of pxb1988/dex2jar@b5bda4fb49 (2026-09-08).
Data as JSON: /api/errors/b0a6d5709d48817c.
Report an issue: GitHub.
Appendix: source
Thrown at dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarWeaverCmd.java:23
import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.nio.file.Path;
@BaseCmd.Syntax(cmd = "d2j-jar-weaver", syntax = "[options] jar", desc = "replace invoke in jar", onlineHelp = "https://sourceforge.net/p/dex2jar/wiki/JarWeaver")
public class JarWeaverCmd extends BaseCmd {
@Opt(opt = "o", longOpt = "output", description = "output .jar file", argName = "out-jar-file", required = true)
private Path output;
@Opt(opt = "c", longOpt = "config", description = "config file", argName = "config", required = true)
private Path config;
@Opt(opt = "s", longOpt = "stub-jar", description = "stub jar", argName = "stub")
private Path stub;
@Override
protected void doCommandLine() throws Exception {
if (remainingArgs.length == 0) {
throw new HelpException("no jar");
}
InvocationWeaver invocationWeaver = (InvocationWeaver) new InvocationWeaver().withConfig(config);
try (FileSystem fs = createZip(output)) {
final Path outRoot = fs.getPath("/");
for (String str : remainingArgs) {
Path p = new File(str).toPath();
System.err.println(p + " -> " + output);
if (Files.isDirectory(p)) {
invocationWeaver.wave(p, outRoot);
} else {
try (FileSystem fs2 = openZip(p)) {
invocationWeaver.wave(fs2.getPath("/"), outRoot);
}
}
}
if (stub != null) {View on GitHub (pinned to b5bda4fb49)