The folder Test contains various files and folders. I want to create a jar that contains only the Test’s sub-folders and files, without the directory’s name (Test) in hierarchy.
I’ve tried:
ProcessBuilder createJarProcess2 = new ProcessBuilder("jar", "cMf", "test.jar","test");
p = createJarProcess2.start();
stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
// read any errors from the attempted command
while ((s = stdError.readLine()) != null) {
System.out.println(s);
}
p.waitFor();
System.out.println("create jar 2 " + p.exitValue());
But includes also the directory’s name.
Thanks
See the
-Coption:Example:
Happy coding.