views:

88

answers:

4
+1  A: 

Yes, this is possible.

Have a look at JNBrige: http://www.jnbridge.com/

But, to be honest, I think it would be better to rewrite your APIs in .Net. Makes it easier in the end imho. I prefer working in one environment and not having to maintain things at different places.

Maximilian Mayerl
I second the idea of rewriting your APIs in C#. Your idea just oozes with potential testing and maintenance issues.
northpole
+2  A: 

Depends on what your java library does and if it uses many third party components, but thanks to IKVM you could compile a jar file into a .NET assembly. I've used this approach to incorporate the xhtmlrenderer java library into a C# application with success.

Darin Dimitrov
+1  A: 

have you considered using webservices? You could also execute a java program using something like:

private void calljava(object ob,EventArgs arg)
    {
        Process.Start("j.bat");
    }

There is also JNBridge

Just a few ideas....

northpole
+1  A: 

Assuming you have properly structured your Java code, creating a Web Service bridge between the two could be the way to go. For example you could expose the Java API through a SOAP and simply make the C# UI depend on that.

The great side in this solution of course is that if you do it this way, you can replace the UI completely at any point you want to, downside is that you would have to run the Java part separately in a context such a servlet container which may be quite heavyweight for your needs.

Esko