本文介绍了在 JDK 4 中使用 apache poi 3.9 的解决方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个后续问题 此处 .我刚刚在 Apache POI 网站中找到了这个标题.

This is a follow up question here . I just found this caption in Apache POI website.

POI 3.5 及更高版本需要 JDK 1.5 或更高版本.3.5 之前的版本需要 JDK 1.4+

显然,这就是我无法构建 Java 程序的原因.我只想知道是否有任何解决方法可以使用我当前的设置在 Ant 中成功构建我的项目.

Clearly, that's the reason I can't build my Java program. I would just like to know if there are any workarounds where I can successfully build my project in Ant using my current settings.

  • Apache POI - 3.9
  • JDK - 1.4.2 (4.0)

欢迎提供任何建议、技巧或技巧.提前致谢!

Any advice, tips, or hacks are welcome. Thanks in advance!

推荐答案

Java 1.4 现在已经很老了 - 它于 2002 年发布,距今已有 10 多年的历史.常规支持于 2008 年结束,所以我不敢想象您需要向 Oracle 支付多少费用才能为其提供扩展支持……如果可能,将部分现金用于升级项目!

Java 1.4 is pretty old now - it was released in 2002 so over 10 years ago. Regular support ended in 2008, so I dread to think how much you're having to pay Oracle for extended support for it... If possible divert some of that cash to an upgrade project!

在 Java 1.4 上运行的最新 Apache POI 版本是 POI 3.2,于 2008 年 10 月发布.来源它的二进制包可以从 Apache dist 存档 获得.今天使用 POI 3.2 有两个主要障碍,第一个是它只支持二进制文件格式.它不支持 OOXML 格式,例如 .xlsx、.pptx、.docx.对那些(通过 XSLF、XSSF 和 XWPF)的支持仅在 POI 3.5 中引入,并且最低要求是 Java 5.第二个问题是您将错过 5 年的错误修复和新功能,有很多!

The last version of Apache POI to run on Java 1.4 was POI 3.2, released in October 2008. Source and binary packages of it are available from the Apache dist archive. There are two main snags with using POI 3.2 today, the first is that it only supports the binary file formats. It does not support the OOXML formats such as .xlsx, .pptx, .docx. Support for those (via XSLF, XSSF and XWPF) was only introduced with POI 3.5, and required the bump to Java 5 as the minimum. The second issue is you'll be missing out on 5 years of bug fixes and new features, of which there have been a lot!

自从有人在旧 JDK 上询问更新版本的 Apache POI 已经有几年了(其他人都设法升级到具有正常支持的东西!).当人们询问时,一个常见的答案是尝试 Retroweaver,它应该可以让您加载和运行 JDK 5 代码JDK 1.4.我自己没有尝试过,但给出这个答案的人似乎很高兴,所以我认为它会成功......

It's been a few years since anyone asked about newer versions of Apache POI on old JDKs (everyone else has managed to upgrade to something with normal support available!). When people were asking, a common answer was to try Retroweaver, which should let you load and run JDK 5 code on JDK 1.4. I've not tried it myself, but people given that answer seemed to be happy so I assume it'll do the trick...

(将 POI 3.9 转换为在 JDK 1.4 上运行对您来说将是很多工作.从 3.2 天开始,大部分新代码都使用了泛型,通过转向泛型,大量旧代码得到了极大的整理和简化,我认为有一些奇怪的可变参数,一些关于日期格式化程序的东西敲响了警钟,还有所有的 XML 东西.它可以完成,但不会很快)

(Converting POI 3.9 to run on JDK 1.4 would be a lot of work for you. Since the 3.2 days, most of the new code has used generics, lots of old code has been greatly tidied up and simplified by moving to generics, I think there's the odd bit of varags, something about date formatters rings a bell, and there's all the XML stuff. It could be done, but it won't be quick)

这篇关于在 JDK 4 中使用 apache poi 3.9 的解决方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 12:11