Search code examples
dllikvm

produce non dependent ikvm dll from jar


I have the need to convert a jar to a dll which I achieved with ikvm. However anytime i add the dll to a c# project in visual studio it complains that i need to add a reference to ikvm.openjdk.core.dll.

The type 'java.lang.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'IKVM.OpenJDK.Core, Version=7.0.4335.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58'.

Is there a way i can convert the jar to a dll without this dependency? maybe some command that would "build" everything together into one dll? Thanks


Solution

  • No, it is not possible to compile the jar to a .NET assembly without this dependency, since the IKVM compiler will remap the usage of the native Java classes to the .NET implementation of the Java classes contained in this assembly (or other IKVM assemblies depending on the classes in your code).

    If the number of assemblies is the problem you can merge them. See How do I merge multiple .net assemblies into a single assembly?