wood burning stoves 2.0*
The moose likes Java in General and the fly likes C++ to JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "C++ to JAVA" Watch "C++ to JAVA" New topic
Author

C++ to JAVA

Rohan Kalbhor
Ranch Hand

Joined: Aug 18, 2006
Posts: 78
hello all,
i am trying to develop a software which is a bridge between CPP and JAVA.My main idea is to translate cpp events into java events
is it possible ?


please help,
Regards
Rohan Kalbhor



[ Edited to correct title - Paul Sturrock ]
[ August 29, 2007: Message edited by: Paul Sturrock ]

..............................<br />Exceptions are a part of possibility<br />Errors are a part of truth<br />................................
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

First of all, what is CPP? Do you mean C++, or is CPP something else? Assuming you mean C++, then what is a "C++ event"? It isn't a standard part of the C++ programming language (as far as I know - it's been a long time since I've used C++ for a serious project).

Can you explain in more detail what you want to do?

To interface Java with native code written in C or C++, you can use JNI (Java Native Interface).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Rohan Kalbhor
Ranch Hand

Joined: Aug 18, 2006
Posts: 78
actually there are 2 softwares,one which is build on C++ and other on Java,i want to create a coupling between the 2 softwares
so the data passed from the C++ software can be understood by the Java software
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Then JNI is your answer, as Jesper suggests.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Yes, JNI is an answer, but there are also other possibilities. Which solution is good for your particular situation depends on what you want to do exactly.

With JNI, you can call code written in C++ directly from your Java code, or the other way around. You could also make the C++ and the Java programs two separate programs that are running alongside each other, and make them communicate via a socket connection. You could also make the C++ program write its data to a database or to a file, and make the Java program pickup the data from there.

So, can you explain in more detail what you want to do? How should the C++ and Java code communicate? Should the communication be synchronous or asynchronous?
Rohan Kalbhor
Ranch Hand

Joined: Aug 18, 2006
Posts: 78
thank you all for your knowledge,
i am now very sure that JNI is the solution,the software which i am developing takes data/events in real time.
Now my issue is that i want to pass this data/events from software#1 which happens to be developed in C++,to software#2 which is developed in Java .
I just want that software#2 should understand everything data/events coming its way

Thanks in advance
Rohan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: C++ to JAVA
 
Similar Threads
jdbc+mysql
How do i map the data type from my java prg to a field in my database
help with ms sql server 2005
Convert LDIF file to Excel
Java/XML developer needed - Part time