Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Data exchange between Java and non-java apps

Posted on 1998-07-27
4
269 Views
Last Modified: 2010-05-18
Hi!

I have an application not-written in Java (can be c, c++ or something else)  I need to create a Java applet (or application if it's impossible with an applet) that will request username/password from the user.  The java app will be called by the non-java application (they're both on the same machine).  Once the user entered his data, they need to be passed back to the calling app, and that's where i'm stuck.  I'd rather not use a socket, nor a temp file or native code.  I thought a pipe stream would be the answer, but then, how to bind the ends of the stream?  
0
Comment
Question by:asavard
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:mjenkins
ID: 1228410
If I correctly understand your needs (which I'm not sure that I
do), you could use the standard out of the java application as
trapped by your non-java implementation. Quick example:

public class Foo
{
    public static void main( String args[] )
    {
        System.out.println( "LOGIN" );
        System.out.println( "PASSWORD" );
    }
}  

.called by a shell script...

echo Here is some output `java Foo` that you can use

yields the following:

Here is some output LOGIN PASSWORD that you can use

Have I oversimplified your problem?
0
 

Author Comment

by:asavard
ID: 1228411
You did oversimplified it.  I'll try to make myself clearer (being a french Canadian gives me trouble when trying to explain things that I don't really understand myself!!)

First of all, I need to use the awt package.  So a call to the shell won't work I think.  I'd use two edit boxes to get the information, and upon a click to OK, data will be sent back to the calling application (which is a graphic interfaced one too).  So, the problem remains to establish a connection between the two apps to do the data exchange.  What i'm trying to do is create a kind of piped stream, but for apps in two different langages.

For now, the only solution I've found is to make data exchange through the clipboard.  (It works, but I could use better security.

Thanks!
0
 
LVL 3

Accepted Solution

by:
mjenkins earned 90 total points
ID: 1228412
I'm sorry, I think you misunderstood me. It is irrelevent as to
whether or not either application is GUI based. The point is to
pipe the standard output stream of the java app to the non-java
app. Sure pop up your dialog box. But after OK is pushed, write
the data to standard out ( System.out.println() ) and read it in
to the calling application.
0
 

Author Comment

by:asavard
ID: 1228413
Well, it seems that this is something that could be done.  I'll try it.  Thanks for your answer.  (I still like my clipboard solution).

To read from Stdin in C, how could it be done.  (I don't want data to be printed out on screen)

Bye
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question