Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-21-2008, 01:42 PM
Member
 
Join Date: May 2008
Posts: 1
apremanandh is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-21-2008, 01:48 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,592
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Yes you can't.

Try something like,

Code:
Runtime.getRuntime().exec()
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-21-2008, 03:33 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
You're using a prefix string "\\" in windows, which is i think is different from Linux, Mac and Solaris, try to search for it...
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by sukatoa : 05-21-2008 at 03:35 PM.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-21-2008, 04:04 PM
Member
 
Join Date: May 2008
Posts: 5
CompleteBeginner is on a distinguished road
Quote:
You're using a prefix string "\\" in windows, which is i think is different from Linux, Mac and Solaris, try to search for it...
With regards sukatoa for cross platform isnt there the seperator keyword for this?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute an External Program through Java program Java Tip java.io 0 04-04-2008 04:40 PM
How to execute an External Program through Java program JavaBean Java Tips 0 10-04-2007 11:33 PM
Unable to execute command line command in java LordSM New To Java 1 08-08-2007 02:23 AM
Execute a new program in java mathias Advanced Java 1 07-31-2007 07:42 AM
Need to write a program to execute a list of system commands mdthahir Networking 1 07-27-2007 07:46 PM


All times are GMT +3. The time now is 03:05 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org