Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling Java from C#

843829Sep 10 2010 — edited Sep 11 2010

Long story but we need to call Java code from our C# app (using J# won't work). Any suggestions on the best way to do this?



The best we've come up with is we have a Java app that's a "server" and talk to it over TCP/IP but that strikes me as overkill when everything is on the same machine.



Any suggestions?



thanks - dave

Comments

843829
david@windward.net wrote:

we need to call Java code from our C# app
Any suggestions on the best way to do this?

The best we've come up with is we have a Java app that's a "server" and talk to it over TCP/IP
Sounds reasonable.
but that strikes me as overkill when everything is on the same machine.
overkill? why?
796085
You could start an embedded JVM using the JNI Invocation API.
843829
Bingo - I think this is it!

thanks - dave
EJP
Note: This thread was originally posted in the [Remote Method Invocation (RMI)|http://forums.sun.com/forum.jspa?forumID=58] forum, but moved to this forum for closer topic alignment.
david@windward.net wrote:

Long story but we need to call Java code from our C# app (using J# won't work). Any suggestions on the best way to do this?

Create a java app. Add a comm API.
Using C# Process to run it as an executable.
Write C# code to talk to it via the comm API.
and talk to it over TCP/IP but that strikes me as overkill when everything is on the same machine.
Why?
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 9 2010
Added on Sep 10 2010
5 comments
262 views