c# - 如何 IKVM Apache POI

标签 c# java apache apache-poi ikvm

我想在我的 .NET 应用程序中使用 Apache POI,我知道有一个端口 NPOI,但它不完整并且没有与 PowerPoint 相关的功能。

我尝试使用以下命令对它进行 IKVM:

ikvmc -target:library poi-3.8.jar poi-ooxml-3.8.jar poi-ooxml-schemas-3.8.jar poi-excelant-3.8.jar poi-scratchpad-3.8.jar

但是当我在执行应用程序的结果 dll 中使用类后,出现了这个错误:

The type initializer for 'org.apache.poi.xslf.usermodel.XMLSlideShow' threw an exception.

有人可以告诉我可以下载 IKVMed Apache POI 的链接吗?用谷歌搜索了一下,但到目前为止运气不太好。

最佳答案

我刚刚完成了使用 IKVM 成功转换 POI 3.9 的项目。

先决条件:

  • 下载 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

希望对您有所帮助。

关于c# - 如何 IKVM Apache POI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13685234/

相关文章:

c# - "does not contain a definition...and no extension method.."错误

java - Spring中如何引用属性中的常量

java - 名为 ThreadSafe 的注解

java - 在 Eclipse 中,如何访问另一个项目中的资源?

oracle - mod_jk 给出错误的网关

javax - getSession 返回 null

c# - 使用不同的界面使用 Web 服务

c# - 控制台应用程序无法从服务器连接到 sql server 实例,但可以从本地计算机连接

c# - 结合 2 个数字成为日期 C#

phpMyAdmin 对于 php 5.5.8 出现错误 404