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 / March 2007

Tip: Looking for answers? Try searching our database.

Starting an mac application

Thread view: 
Christian - 14 Mar 2007 20:49 GMT
Hello

I have got some Mac Application that I want to start with some parameters

...
    ProcessBuilder pb = new
ProcessBuilder(tooFreeApp.getPath(),"-data",myRootPath.getPath(),apparguments);
    pb.redirectErrorStream(true);
    process = pb.start();
    BufferedReader i = new BufferedReader(new InputStreamReader(
process.getInputStream() ) );
    String read;
    while (null != (read =i.readLine())) {System.out.println(read);}

...

the code above seems to work on windows with some .exe file  but not on
mac with the corresponding .app file.

Someone got an idea what I could do?

Christian
vladimir.olexa@gmail.com - 14 Mar 2007 23:04 GMT
Well, .exe is an entirely different concept than .app. .app is nothing
but a package, a directory if you will, so passing parameters to it
isn't actually passing it to the executable but to the whole package.
So the actual UNIX executable is really located inside that package.
Let's say you have an app called Foo.app, then your executable would
be in Foo.app/Contents/MacOS/Foo. So you may wanna try to pass your
parameters directly to that and see if that works.

Hope this helps.

> Hello
>
[quoted text clipped - 18 lines]
>
> Christian
Christian - 15 Mar 2007 17:51 GMT
vladimir.olexa@gmail.com schrieb:
> Well, .exe is an entirely different concept than .app. .app is nothing
> but a package, a directory if you will, so passing parameters to it
[quoted text clipped - 3 lines]
> be in Foo.app/Contents/MacOS/Foo. So you may wanna try to pass your
> parameters directly to that and see if that works.

this doesn't work ...
if I start Foo.app/Contents/MacOS/Foo directly the program will just crash.

may be I can use
open -a Foo.app parms         somehow ?

> Hope this helps.
>
[quoted text clipped - 20 lines]
>>
>> Christian
Christian - 15 Mar 2007 19:41 GMT
Christian schrieb:
> vladimir.olexa@gmail.com schrieb:
>> Well, .exe is an entirely different concept than .app. .app is nothing
[quoted text clipped - 10 lines]
> may be I can use
> open -a Foo.app parms         somehow ?

open Foo.app

does not work with process builder, but with Runtime.getRuntime().exec()

though I seem to be unable to pass arguments to the program that way
which is crucial.

someone a hint?

I just need to start that application with some arguments in  a
subprocess... so I know when the app terminates.

thats something that simply must be easy ... shame on me I havend
figured it out by now ...
but I am simply clueless..

please help.

>> Hope this helps.
>>
[quoted text clipped - 20 lines]
>>>
>>> Christian


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



©2008 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.