Search code examples
noclassdeffounderrorikvm

Convert jar to C# dll using IKVM - NoClassDefFoundError


i am using IKVM to convert a java jar file to a c# dll. This jar file has several dependencies, which i referenced all via -r:reference.dll .

Still im getting the following warning and i dont know how to get rid of it:

IKVM.NET Compiler version 7.2.4630.5
Copyright (C) 2002-2012 Jeroen Frijters
http://www.ikvm.net/

warning IKVMC0111: Emitted java.lang.NoClassDefFoundError in "myproject.myclass.setFocus()V"
("org.eclipse.swt.widgets.Control")

The command i am converting the jarfile is:

ikvmc -target:library -debug -out:project.dll -r:org.eclipse.swt.win32.win32.x86_3.5.2.v3557f.dll -r:severalmoreherretofollow project.jar 2> project.log

The class "org.eclipse.swt.widgets.Control" is declared inside the "org.eclipse.swt.win32.win32.x86_3.5.2.v3557f.dll" which had no errors when compiling it with ikvm to a dll.

Thanks in advance


Solution

  • If you compile more as one jar file then it can be recommended to compile it in one step. See the wiki for more details. This prevent you from circulate dependencies.

    I think you need to use a full qualified file name with the -r option.