javac#dllikvm

How do I use IKVM.NET to translate .JAR files into .dll files?


I am building a C# project, which needs to execute java code. Nearly every suggested solution refers to a converter called IKVM. Apparently this converter is able to translate the .JAR files into .DLL files.

I've tried to understand the documentation, but couldn't figure out how to use the converter. I've also installed the NuGet package for IKVM. However, that didn't make me any smarter either

How do I properly install, setup and use IKVM.NET in order to translate .JAR files into .DLL files?

I highly appreciate any suggestion or solution, sheers!


1. Edit

I've followed this installation guide and somehow created a .dll by using the following command.

ikvmc FILENAME.jar -target:library

Nevertheless, I've got many errors while building the .dll


2. Edit - Solution

There are no errors with uncomplicated JAR files and I can use them as a DLL without any problems. Apparently not all Java components used in my JAR files can be translated or found in C#.


Solution

  • Things have changed quite a bit since this question was asked. Please read https://github.com/ikvm-revived/ikvm/blob/main/README.md

    Since then we have released version 8.2.1, which has support for a new feature named IkvmReferences. Which allow you to insert a tag within your MSBuild files to automatically have IKVM convert your JAR files to assemblies.

    Additionally, IKVM.Maven.Sdk allows you to directly reference Maven artifacts from your .NET projects.