Solved

Data exchange between Java and non-java apps

Posted on 1998-07-27
4
273 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
[X]
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
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 238
How to determine if a string is a valid SHA value 7 43
collection output issue 9 61
What browser will run Java? 7 124
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…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

756 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