Java 使用IKVM.Net将ApachePOI.jar转换为.dll

Java 使用IKVM.Net将ApachePOI.jar转换为.dll,java,.net,dll,apache-poi,ikvm,Java,.net,Dll,Apache Poi,Ikvm,我正在尝试将ApachePOI.jar转换为.dll。我使用下面的脚本进行转换。然而,我得到了很多警告和错误无效选项-资源:poi-3.8-20120326.dll。这是我使用的脚本 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-s

我正在尝试将ApachePOI.jar转换为.dll。我使用下面的脚本进行转换。然而,我得到了很多警告和错误无效选项-资源:poi-3.8-20120326.dll。这是我使用的脚本

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

这是使用IKVM.Net的正确方法。如果不是,正确的脚本是什么。

-resource
选项如下:

-resource:name=path包含路径作为名为name的Java资源

因此,这似乎表明
-resource
用于将资源文件包含到编译中,而不是(像您所做的那样)以前编译的DLL

以下示例证实了这一怀疑:
资源
选项如何用于:


您需要将选项-resource替换为-reference

但是最好是用{}语法一步编译它。看。这可能看起来像:

ikvmc { -target:library poi-ooxml-schemas-3.8-20120326.jar } { -target:library poi-3.8-20120326.jar } { -target:library poi-scratchpad-3.8-20120326.jar } ....

我刚刚完成了一个项目,在该项目中,我使用IKVM 0.46.0.1成功地转换并使用了ApachePOI3.9。转换后的DLL集支持2007年之前和2007年之后的Microsoft Office格式

先决条件:

下载POI 3.9并将所有JAR文件复制到一个目录中 下载IKVM(我使用的是0.46.0.1版) 以下命令(在所有POI jar所在的同一目录中的Windows 7命令行中运行)为我实现了这一目的:

ikvmc -target:library xmlbeans-2.3.0.jar
ikvmc -target:library stax-api-1.0.1.jar

ikvmc poi-ooxml-schemas-3.9-20121203.jar -target:library -reference:xmlbeans-2.3.0.dll -reference:stax-api-1.0.1.dll 


ikvmc -target:library log4j-1.2.13.jar
ikvmc -target:library commons-logging-1.1.jar
ikvmc -target:library commons-codec-1.5.jar

ikvmc poi-3.9-20121203.jar -target:library -reference:log4j-1.2.13.dll -reference:commons-logging-1.1.dll -reference:commons-codec-1.5.dll

ikvmc -target:library dom4j-1.6.1.jar

ikvmc poi-ooxml-3.9-20121203.jar -target:library -reference:poi-3.9-20121203.dll -reference:poi-ooxml-schemas-3.9-20121203.dll -reference:dom4j-1.6.1.dll -reference:xmlbeans-2.3.0.dll

希望有帮助。

弗兰克的答案是一次性转换所有罐子,这为我解决了问题。这是我在POI 3.10中使用的完整命令。所有JAR都需要在同一个目录中。out选项允许您指定输出dll的名称,否则它将使用第一个jar中的名称

ikvmc -target:library -out:poi-3.10.dll xmlbeans-2.3.0.jar stax-api-1.0.1.jar poi-ooxml-schemas-3.10-FINAL-20140208.jar log4j-1.2.13.jar commons-logging-1.1.jar commons-codec-1.5.jar poi-3.10-FINAL-20140208.jar dom4j-1.6.1.jar poi-ooxml-3.10-FINAL-20140208.jar 

请看我对类似问题的回答:我会在回到电脑后再试一次
ikvmc -target:library xmlbeans-2.3.0.jar
ikvmc -target:library stax-api-1.0.1.jar

ikvmc poi-ooxml-schemas-3.9-20121203.jar -target:library -reference:xmlbeans-2.3.0.dll -reference:stax-api-1.0.1.dll 


ikvmc -target:library log4j-1.2.13.jar
ikvmc -target:library commons-logging-1.1.jar
ikvmc -target:library commons-codec-1.5.jar

ikvmc poi-3.9-20121203.jar -target:library -reference:log4j-1.2.13.dll -reference:commons-logging-1.1.dll -reference:commons-codec-1.5.dll

ikvmc -target:library dom4j-1.6.1.jar

ikvmc poi-ooxml-3.9-20121203.jar -target:library -reference:poi-3.9-20121203.dll -reference:poi-ooxml-schemas-3.9-20121203.dll -reference:dom4j-1.6.1.dll -reference:xmlbeans-2.3.0.dll
ikvmc -target:library -out:poi-3.10.dll xmlbeans-2.3.0.jar stax-api-1.0.1.jar poi-ooxml-schemas-3.10-FINAL-20140208.jar log4j-1.2.13.jar commons-logging-1.1.jar commons-codec-1.5.jar poi-3.10-FINAL-20140208.jar dom4j-1.6.1.jar poi-ooxml-3.10-FINAL-20140208.jar