i have written the code to create .jar file.
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("jar cvf /var/apache2/htdocs/20070727.jar /usr/local/apache-tomcat/webapps/music/");
// any error message?
StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");
// any output?
StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
int exitVal = proc.waitFor();
System.out.println("ExitValue: " + exitVal);
catch (Exception t)
Its creating the 20070727.jar file successfully but it creates the directory structure as usr->local->apache-tomcat->webapps->music where as my requirement is just from music directory at the top. What should i do to achieve this.
thanks in Advance.