• Post Reply Bookmark Topic Watch Topic
  • New Topic

Runtime.exec() problem

 
vara prasad
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am executing the following code in Linux.


p =Runtime.getRuntime().exec("jar cMf /u01/app/oracle/products/904_infra/j2ee/home/applications/test/twoo.zip -C /u01/app/oracle/products/904_infra/j2ee/home/applications/test/tt .");

When i stored above line in .java file and executing it is working fine. But when executing this by storing in jsp. It is Showing the following error. Not only jar, even for javac,java commands are also not executing.


05/10/04 15:52:03 java.io.IOException: java.io.IOException: jar: not found

05/10/04 15:52:03 at java.lang.UNIXProcess.<init>(UNIXProcess.java:143)

05/10/04 15:52:03 at java.lang.Runtime.execInternal(Native Method)

05/10/04 15:52:03 at java.lang.Runtime.exec(Runtime.java:566)

05/10/04 15:52:03 at java.lang.Runtime.exec(Runtime.java:428)

05/10/04 15:52:03 at java.lang.Runtime.exec(Runtime.java:364)

05/10/04 15:52:03 at java.lang.Runtime.exec(Runtime.java:326)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you doing this out of process?
Have you looked into doing this from within your app using the java.util.zip classes?

http://java.sun.com/j2se/1.5.0/docs/api/java/util/jar/JarFile.html
[ October 04, 2005: Message edited by: Ben Souther ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!