• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

C++ to JAVA

 
Rohan Kalbhor
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15459
42
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Rohan Kalbhor
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then JNI is your answer, as Jesper suggests.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15459
42
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic