I don't know how to word this very well, so please bear with me...

Is there any way to get a java program to respond in different ways to the results of other programs? Like, if an integer in the other program (not written in Java) is greater than say, 56, can you get java to copy the int, then store it?

Recommended Answers

All 8 Replies

Yes. I'm not sure how though. :)

You can embed languages, and you can also always store the result then access it later. I'm sure someone else will explain much better.

Sure, i don't understand how you are "accessing" this other program though.

This is what files are for. Just store the data from the non-Java application into a file, and then read that data from your Java application.

This is what files are for. Just store the data from the non-Java application into a file, and then read that data from your Java application.

I'm pretty sure its more complicated than that. If you read his original statement, it sounds like he wants both programs to be running at once. In which case, I'm sure there are issues with concurrent modification, and there might be issues if he actually wants to read the integer from the memory location (which I guess would require having one program tell the other where the int is stored for starters). Also, one program might have to be embedded in another to accomplish this, although I don't know anything about that. Just throwing some things out there, not as statements of assurance, just as guesses. It'll be interesting to see what someone with more experience has to say about this.

Then use sockets. Listen for incoming data on a certain port in the Java program and send the data on that port in the non-Java program.

hey, thanks guys, sorry i'm just now geting back to you, I've been really busy lately.

~Destin: What are sockets?

~BestJewSinceJC: You pretty much hit the nail on the head, that's my dilemma. I have know Idea what to do >.< grr...

http://java.sun.com/docs/books/tutorial/networking/sockets/

Sockets in java^, if you get stuck on these, I can help you


http://www.prasannatech.net/2008/07/socket-programming-tutorial.html

^ Using sockets to communicate between different programming languages. Do not bother trying to learn the info contained in this link until you understand how to use sockets in Java, which are much easier. Also, I'm only providing you w/ a reference, if you get stuck, I can't help you, since I don't know the information myself. Good luck

Thanks a lot for the links I'm gonna go check those out =D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.