I'm trying to convert Apache poi .jar to .dll . I used the script below to convert. However I'm getting lot of warnings and error Invalid option -resource:poi-3.8-20120326.dll after that. Here's the script i used.
ikvmc -target:library poi-ooxml-schemas-3.8-20120326.jar
ikvmc -target:library poi-3.8-20120326.jar
ikvmc -target:library -resource:poi-3.8-20120326.dll poi-scratchpad-3.8-20120326.jar
ikvmc -target:library -resource:poi-3.8-20120326.dll poi-ooxml-schemas-3.8-20120326.dll poi-scratchpad-3.8-20120326.dll poi-ooxml-3.8-20120326.jar
ikvmc -target:library -resource:poi-3.8-20120326.dll poi-ooxml-3.8-20120326.dll poi-excelant-3.8-20120326.jar
Is this correct way to use IKVM.Net . If not what is the correct script to do this.
I just completed a project where I have successfully converted and used Apache POI 3.9 using IKVM 0.46.0.1. The converted set of DLLs support pre 2007 and post 2007 Microsoft Office formats.
Prerequisites:
Download POI 3.9 and copy all the JAR files into one directory Download IKVM (I used version 0.46.0.1) The following commands (run in Windows 7 command line in the same directory where all the POI JARs are) did the trick for me:
Hope it helps.
The
-resource
option of theikvmc
compiler is documented like this:So that seems to indicate that
-resource
is used to include resource files into the compilation, and not (like you're doing) previously compiled DLLs.This suspicion is confirmed by this example of how the
resource
option is used in an example of the ant wrapper aroundikvmc
:Since
ikvmc
is a java-bytecode-to-.net-intermediate-language compiler, it understands how to read jar files. So instead of trying to include the (previously generated) DLLs into the compilation cycle, you should just pointikvmc
to the original jar files.The simplest way to do this is probably by converting all jars in one go:
Frank's answer of converting all the jars in one go solved the problem for me. Here's the full command I used for POI 3.10. All of the jars need to be in the same directory. The -out option allows you to specify the name of the output dll, otherwise it takes the name from the first jar.
You need to replace the option -resource with -reference.
But the best is to compile it in one step with { } syntax. See the wiki for details. This can look like: