Re: Java Tool with NSTask?
Re: Java Tool with NSTask?
- Subject: Re: Java Tool with NSTask?
- From: Mijobe <email@hidden>
- Date: Sun, 25 Jan 2004 14:51:50 -0500
Considering the ease of interoperating with Java applications unless
there's something stopping you I would execute the Java code myself.
For instance if the command line tool writes its output to System.out
the I would set System.out to an output stream that I could read from.
For instance if I remember correctly you can use a PipedOutputStream
connected to a PipedInputStream or a ByteArrayOutputStream and read
from that. Once you set System.out then simply call the main method on
the Java class and have it do its thing. If that doesn't make sense I
can provide you some example code.
-
email@hidden
<xinjen/>
On Jan 25, 2004, at 4:15 AM, Sherm Pendley wrote:
On Jan 25, 2004, at 3:30 AM, Fabio Genoese wrote:
I would like to access a Java command line tool from Cocoa
(Objective-C app). As you can imagine, I need its output. I know
there's NSTask for UNIX command line tools and of course there's
NSPureApplication in the Java AppKit for java tools (ONLY for the
Java AppKit) but what about using java tools from Objective-C? Any
ideas?
Couldn't you simply use NSTask to run /usr/bin/java just like you
would any other UNIX tool? All you'd need to do is pass the path to
your Java app as an argument, as well as any other relevant arguments
you'd use to run the app from a shell.
sherm--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.