Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java application on Windows calls native app on Sun?

Reply
Thread Tools

Java application on Windows calls native app on Sun?

 
 
Paul Lee
Guest
Posts: n/a
 
      07-31-2003
Dear everyone,
Just thought I'd drop by and ask a question thats confounding me (yes,
I am a newbie!).
If I had a Java app on Win2k, and wanted to call a remote C++
application on a Sun machine, how would I go about doing this?
I'm guessing that I'd use RMI to allow JVMs to talk across a network
(??)
and then use JNI to get the Sun's JVM to access the Sun Machine's C++
application methods? I don't think we can follow the examples given
for JNI on the Sun website as we don't have the source code for the
app on the Sun, although we have found out that the methods are
exposed, like a COM interface.

I think.
Can anyone help?

Best wishes

Paul
 
Reply With Quote
 
 
 
 
Andy Fish
Guest
Posts: n/a
 
      07-31-2003
RMI is one option, others might be:

soap
corba
http request
dcom (probably not worthwhile unless both are windows)
rpc
some other home grown socket interface

you probably should read up on the relative pros and cons of these. If RMI
is your preferred solution then yes you are right about implementing JNI on
the sun side to call the C++ object.

Andy

"Paul Lee" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Dear everyone,
> Just thought I'd drop by and ask a question thats confounding me (yes,
> I am a newbie!).
> If I had a Java app on Win2k, and wanted to call a remote C++
> application on a Sun machine, how would I go about doing this?
> I'm guessing that I'd use RMI to allow JVMs to talk across a network
> (??)
> and then use JNI to get the Sun's JVM to access the Sun Machine's C++
> application methods? I don't think we can follow the examples given
> for JNI on the Sun website as we don't have the source code for the
> app on the Sun, although we have found out that the methods are
> exposed, like a COM interface.
>
> I think.
> Can anyone help?
>
> Best wishes
>
> Paul



 
Reply With Quote
 
 
 
 
Paul Lee
Guest
Posts: n/a
 
      07-31-2003
Hi all,
Thanks for your replies - what I meant when I said "call an
application" was call methods within that application, such as alter
the appearance of the GUI or retrieve data from the app.

The thing that is confounding me is the Sun Java JNI example talks
about interfacing with an C++ app when the source code to that app is
available - in this case, it won't be, although we do have the app's
APIs to hand.

All in all, a bit of a mess!

Best wishes

Paul
 
Reply With Quote
 
Joseph Millar
Guest
Posts: n/a
 
      08-01-2003
On 31 Jul 2003 15:22:08 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (Paul Lee) wrote:

> Hi all,
> Thanks for your replies - what I meant when I said "call an
> application" was call methods within that application, such as alter
> the appearance of the GUI or retrieve data from the app.


If this application is already up and running, then it has
to provide the communication mechanism.

> The thing that is confounding me is the Sun Java JNI example talks
> about interfacing with an C++ app when the source code to that app is
> available - in this case, it won't be, although we do have the app's
> APIs to hand.


What sort of API's? JNI is simple, it allows your executing
Java code to call into code you have written in C or C++ which
is in the form of a dll or shared library. What you do once
you are in C/C++ is entirely up to you. If you want to call
some other API to talk to some external app, have a good time.

So if you're goal is to talk from your Java code to some other
app, you have to first find out what the other app is using
to talk with. Then you need to look at your Java code and
see if Java provides the means to understand that form of
communication. If it does, then you have to look at your
environment and see if that imposes any further restrictions.
For example, if the app provides callable API's and these
API's do their work using shared memory, calling these on
a physically different machine would not work.

It's impossible for us to give you a definitive answer based
on the little (and unclear) information you have provided.

--Joe
 
Reply With Quote
 
 
 
Reply

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wx.ToplevelWindow.SetIcon: Native MS Windows error dialog pops upin wxPython app, no exception raised, no stack trace Laszlo Nagy Python 3 09-13-2007 02:08 PM
How do I launch a new Java app from a running Java app? steve.albin@gmail.com Java 3 01-03-2007 04:59 PM
jni to optimize a java application using native mathematical libraries dimitri.ognibene@gmail.com Java 16 04-06-2006 10:01 AM
Java application that calls Windows API methods Si Java 6 02-20-2006 03:14 PM
windows app embed java app Peter Java 0 02-22-2005 10:03 AM



Advertisments