Results 1 to 4 of 4
- 05-21-2008, 11:42 AM #1
Member
- Join Date
- May 2008
- Posts
- 1
- Rep Power
- 0
Execute a jar command from a java program
Hi,
I need to execute a jar command from the java program. And also need, that jar command must execute in the place (path like "C:/Sample/ jar..") where specified. current i am using
In Windows,
String cmd = "cmd /c jar uf " + instalationPath + jarName + " " + param ;
Runtime.getRuntime().exec(cmd);
But, i am not able to use the same command for Linux, Solaris and Macintosh, please help to resolve this issue.
Any equivalent command are available?.Kindly Help Me.
- 05-21-2008, 11:48 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Yes you can't.
Try something like,
Java Code:Runtime.getRuntime().exec()
- 05-21-2008, 01:33 PM #3
You're using a prefix string "\\" in windows, which is i think is different from Linux, Mac and Solaris, try to search for it...
Last edited by sukatoa; 05-21-2008 at 01:35 PM.
freedom exists in the world of ideas
- 05-21-2008, 02:04 PM #4
Member
- Join Date
- May 2008
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM -
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM -
Unable to execute command line command in java
By LordSM in forum New To JavaReplies: 1Last Post: 08-08-2007, 12:23 AM -
Execute a new program in java
By mathias in forum Advanced JavaReplies: 1Last Post: 07-31-2007, 05:42 AM -
Need to write a program to execute a list of system commands
By mdthahir in forum NetworkingReplies: 1Last Post: 07-27-2007, 05:46 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks