Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java and C# in 1 project

 
Vu Pham
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to write a project with both Java & C# . I will compile C# code to .dll file . How can I use that .dll file in Java code ?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java has the Java Native Interface (JNI) technology to call to a C/C++ module with methods specially crafted just for this purpose. The C module could call to your C# module and back again. If your C# program is a COM server, Google for "java com bridge" frameworks. Some are free and some are good. Not sure any are both. And you can go for inter-process communication over sockets or HTTP. I think there is a decent Java-DDE implementation, too.

Any of those sound promising? I don't do .net so I could easily be unaware of other really cool options.
[ October 17, 2005: Message edited by: Stan James ]
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not compile your Java to MSIL?
I haven't googled it, but I'll bet such a thing exists nowadays (haven't used .NET in a while).
The CLR Specification is quite clearly designed to provide a migration from Java. I'm surprised it doesn't explicitly state it, though one might argue that it does.
 
Vu Pham
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you can go for inter-process communication over sockets or HTTP


Would you like to give me some tutorials about that ? Thanks very much .
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tony Morris:
Why not compile your Java to MSIL?
I haven't googled it, but I'll bet such a thing exists nowadays (haven't used .NET in a while).
The CLR Specification is quite clearly designed to provide a migration from Java. I'm surprised it doesn't explicitly state it, though one might argue that it does.


check this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic