Convert Java to .NET library using IKVMC - Warning IKVMC0108: not class file

There is a Java tool (called Mallet) http://mallet.cs.umass.edu/download.php that I want to use in my .NET project.

To convert this tool to a .NET library first, I tried to create it in a single .jar file using Apache Ant. I did everything that follows the instructions in the link above.

  • Download the developer version from the Mercurial repository.

  • Download Apache Ant, install JDK, set JAVA_HOME var to use Apache Ant.

  • Using Ant, I created one mallet.jar file.

And then I would convert mallet.jar to a .NET library using IKVMC. When converting, I have many warnings, such as:

Warning IKVMC0108: not a class file "cc/mallet/util/tests/TestPriorityQueue$1.cl ass", including it as resource (class format error "51.0") 

Despite these warnings, mallet.dll was created. But when I try to reference it from my .NET project, it looks "empty". It does not have classes or namespaces. I remember to reference IKVM.OpenJDL.Core.

And it’s unusual that I can’t find any problems on Google.

I think the problem is warnings. And I never worked with Ant, and I definitely don’t understand the whole process.

+4
source share
2 answers

The version 51 class format was introduced with Java 7.

IKVM most likely does not support this version, and the name of the file you specify ( cc/mallet/util/tests/TestPriorityQueue$1.class ) points to the anonymous inner class TestPriorityQueue , which, of course, is necessary for the library to work correctly.

My suggestion: compile Mallet using the old JDK, or at least with the -source and -source switches set to 6 (to ensure it compiles for Java 6).

+6
source

All Articles