My java uses ProcessBuilder
to run several commands using other jar
that I have added in the resources.
It works fine in Eclipse, but once I export it to executable jar
, it doesn't work:
//Defs Class has this line
public final static String APKTOOLS_JAR_PATH = Defs.class.getResource("/apktool.jar").getPath();
ProcessBuilder pb = new ProcessBuilder("java", "-jar", Defs.APKTOOLS_JAR_PATH, "d", apkPath, "-o", decodePath, "-f");
pb.redirectError(Redirect.INHERIT);
Process p = pb.start();
I get back:
Error: Unable to access jarfile apktool.jar