Using Java classes with C #

I have a project written in Java (> 1.5).

Is it possible to write parts of a project using C #?
For example, a GUI and calling methods and instantiating classes written in java?

If so, how?

+5
java c #
Oct 05 '08 at 8:52
source share
6 answers

Something called the Java Language Conversion Assistant for .NET. You can convert your Java classes to C # and start coding.

There is also something called JNBridge (not free).

+6
05 Oct '08 at 9:02
source share

I am the author of jni4net , an open source interprocess bridge between the JVM and the CLR. It is built on top of JNI and PInvoke. No C / C ++ code required. Hope this helps you.

+17
Oct. 31 '09 at 19:36
source share

Not with something like ikvm - or through web services, etc. to communicate between the two parties. Basically, this is likely much more than rewriting existing project code in C # or writing a GUI in Java.

+9
Oct 05 '08 at 9:00
source share

It seems my decision is very limited. and apply only to a specific version of java.

I will probably stay with the good old C :) I can not imagine how to work without shared libraries :)

This document explains how to create a dll from java and use it in C code. I am not an expert in C # or java, but I am sure that you can also load an external dll in C #. So not a complete solution, but a good starting point, IMHO. This is usually the perfect way to mix languages.

+4
Oct 05 '08 at 9:08
source share

In a simple way, you can pack your java classes into a jar file, then In C # use the Process class to execute and display the input / output stream

+2
Oct 05 '08 at 15:43
source share

I did some research on this a few years ago (2005), and I liked JNBridgePro as the best third-party product for this. Take a look here http://www.jnbridge.com/

Good luck

0
Nov 12 '08 at 20:04
source share



All Articles