Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Experiences with IKVM.NET

Tags:

java

.net

interop

Is IKVM.NET a good way to use Java Code or Java Libs in .NET applications?

Has anybody experiences with this tool? Are there alternatives? Are there possibilities to call Java functions/code in COM-based applications like Visual Basic 6 or Classical ASP?

like image 203
Kottan Avatar asked May 20 '10 14:05

Kottan


2 Answers

I've used this tool and especially the compiler to convert a JAR file to .NET assembly. It was for the xhtmlrenderer project which allows to convert an XHTML file to PDF and is based on iText which is not a small code base. The conversion went fine and I am using it in production without any flaws.

like image 194
Darin Dimitrov Avatar answered Oct 07 '22 04:10

Darin Dimitrov


I've just started using this tool and it is quite amazing how it integrates .Net and Java. I was using it to convert a library that was only available in java to a .net assembly.

The good:

  • Extremely easy to use
  • Small footprint(the assemblies are not that big, and you don't need all of them all of the time)
  • Project seems to be well maintained and the sourceforge feedback seems good

The bad:

  • Debugging is a little more difficult. The Visual Studio exception handler looks for a message property that is blank in java. The result is that you have to make temporary try...catch block and put a watch on the exception object to inspect the details of the java exception
  • classpath resources can be difficult to load and work with.
  • Javadoc strings are not converted through so don't expect to see tips with intellisense, you will have to read through javadoc html to get help.

Overall it's been a pleasant experience, but I have admittedly only been using it for 2 days now.

like image 33
Tjaart Avatar answered Oct 07 '22 05:10

Tjaart