Domanda

I'm using weka for C#, and trying to port the weka.jar into c#-dll using IKVM. The tutorial can be found here.

Now, here are what I got in my bin directory of C# program:

weka.dll --generated by IKVM

IKVM.OpenJDK.Core.dll -- from IKVM libs

JVM.dll -- from IKVM libs

and java/bin is in my PATH variable.

But the program breaks down at

weka.core.Instances insts = new weka.core.Instances(new java.io.FileReader("iris.arff"));

and the error is at initializing java.io.File

I think it is because some dll's are missing in C#/bin

I can solve it by copying every dll's related with IKVM and Java into the C#/bin directory. However it is so ugly.

Now comes my question: What runtime libraries does a Java ==IKVM==> C# program need indeed?

Update

I copied everything related into the C#/bin and it worked.

But do believe me that I dont't wanna do this.

È stato utile?

Soluzione

Never without you can answer the question which parts of Java/IKVM your program need. You are the only person that know your program. A small program need approx 50% of the IKVM dlls. This is because the dependencies in Java are very large.

The minimum is IKVM.OpenJDK.Core.dll and IKVM.Runtime.dll. But I would not add dll by dll. Else I would remove it step by step. You can use the dll file names or Ilspy to see which dll do you probable does not need.

Here are some which are use rare and for which it is used. This can give you a hint:

  • IKVM.OpenJDK.Tools.dll - Java Compiler
  • *.exe - different tools
  • IKVM.OpenJDK.Jdbc.dll - SQL and database API
  • IKVM.OpenJDK.Corba.dll - Corba
  • IKVM.OpenJDK.Beans.dll - Plain Old Beans
  • ikvm-native-win32-*.dll, JVM.dll, IKVM.Runtime.JNI.dll - native stuff, if your Java code use already a dll
  • IKVM.OpenJDK.Naming.dll - Naming services like LDAP, DNS
  • IKVM.AWT.WinForms.dll, IKVM.OpenJDK.SwingAWT.dll - Images, Fonts, GUI
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top