Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Exec

Thread view: 
Francois Lionet - 30 Apr 2007 08:43 GMT
Hi all,

First of all, I must thank you : I have asked 5 questions in this forum, and
each time I had a good answer that really helped me. So thank you!

My new question :
I want to launch an external program from my application (currently under
Windows, but I want it to work as well on a Mac and Linux). I have the
pathname to the application (as a File object). But I can't find the method
to actually launch the application. I have searched in the system object,
and the file object. No success.
Can anyone tell me how to do this?

Thanks in advance.

Francois
Andreas Wollschlaeger - 30 Apr 2007 09:25 GMT
> Hi all,
>
[quoted text clipped - 12 lines]
>
> Francois

Hi Francois,

have a look at the various exec() methods in java.lang.Runtime, this is
perhaps what you are looking for.

But beware that their use is somewhat tricky, as you have to consume the
process' output, else it may block when some internal buffer is full.

I can send you some helper class for Runtime.exec(), just send me a
short email to /d/5/0/3/@/d/i/r/e/c/t/b/o/x/./c/o/m , without the
slashes, of course :-)

Cheers
Andreas
Francois Lionet - 30 Apr 2007 16:17 GMT
>> I want to launch an external program from my application (currently under
>> Can anyone tell me how to do this?
> have a look at the various exec() methods in java.lang.Runtime, this is
> perhaps what you are looking for.
> Cheers
> Andreas

Thanks Andreas, this was exactly what I was looking for. Does anyone know an
address where I can download the Java SE Platform 6 docs all at once? I'd
rather have the docs on my machine, and I could not find a link on the Sun
site...

Francois
Eric Sosman - 30 Apr 2007 16:31 GMT
Francois Lionet wrote On 04/30/07 11:17,:
>>>I want to launch an external program from my application (currently under
>>>Can anyone tell me how to do this?
[quoted text clipped - 8 lines]
> rather have the docs on my machine, and I could not find a link on the Sun
> site...

   http://java.sun.com/javase/downloads/index.jsp

Signature

Eric.Sosman@sun.com

Robert Mark Bram - 01 May 2007 01:39 GMT
Hi Francois,

One thought about this aspect.

> but I want it to work as well on a Mac and Linux). I have the
> pathname to the application (as a File object). But I can't find the method

The path (and even name) of your command might be different in the
different environments. It would be worth while to externalize the
definition of your command into a database or properties file that can
be changed for each environment.

Rob
:)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.