Overclockers Australia Forums
OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Programming & Software Development

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 18th March 2004, 5:44 PM   #1
Browndog Thread Starter
Member
 
Join Date: Jul 2001
Location: Adelaide
Posts: 599
Default Launching an application from a java program

I'm wondering how to launch an application from a java program, I'm wirting a java progam to break a string up an then launch a program with the parameters from the string. I'm using linux so I need to know how to launch an app from java.
__________________
Intel D975XBX2, Core2 Duo E6600, 4Gb Corsair DDR2, radeon x1950XT, 2x 36Gb raptor, SB Audigy2 ZS, ASUS SATA Burner

GoBusiac Prime
Browndog is offline   Reply With Quote

Join OCAU to remove this ad!
Old 22nd March 2004, 4:45 PM   #2
Wylf
Member
 
Wylf's Avatar
 
Join Date: Jul 2002
Location: Canberra
Posts: 974
Default Re: Launching an application from a java program

Quote:
Originally posted by Browndog
I'm wondering how to launch an application from a java program, I'm wirting a java progam to break a string up an then launch a program with the parameters from the string. I'm using linux so I need to know how to launch an app from java.
you need a java.util.Runtime object (I think its util - might be IO):

Code:
        Runtime rt = Runtime.getRuntime();
        rt.traceInstructions(true);
        rt.traceMethodCalls(true);
        try {
            proc = rt.exec(Application.GATHER_STRING+" "+args);
            while (!processFinished()) {
                synchronized(proc) {
                    while (isSuspended) {
                        proc.wait();
                    }
                }
            }
(sample code lifted from old project)
Wylf is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 10:30 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!