954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Linking Java and C#

is there a way that i can link JAVA with C#??
or that i can write a C# code in a Java code??
THNX

it-1
Newbie Poster
8 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

What exactly are you trying to do?

Be advised that C# and Java do the same things, mostly. Is there something specific that you need Java or C# for that would cause you not to use one explicitly?

If you were talking web applications, you could definitely do things with XML/SOAP to talk between a Java application and a C# application. That's about the only thing that you can do, though-- there's not really an API that I'm aware of that you can use to make the two interact.

alc6379
Cookie... That's it
Team Colleague
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
 

Greetings:
It can be done via JNI, i once did that in 2 steps, from java to c++ and then from c++ to c#, in java`s webpage there`s a tutorial on doing this, from java to c++ and viceversa.
For writing c# code in Java code, im pretty sure that`s not possible since they`re different languages but as alc6379 said almost everything you can do in C# can be done in Java.

ROGENATOR
Newbie Poster
17 posts since Sep 2005
Reputation Points: 11
Solved Threads: 0
 

Hi,

You have some options. Your first and best bet is to use JNI to expose Java functionality native codes and consume them through Platform Invoke. A more exotic approach would be to use one of the free Java VM implementations in C# so that you can interpret Java code within C#. But my suggestion would be to convert from Java to C#, there are wizards facilitating the whole process a lot and this way you won't suffer performance and type incompatibility problems.

Loren Soth

Lord Soth
Posting Whiz in Training
233 posts since Mar 2006
Reputation Points: 28
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You