简体   繁体   English

将 Java UNO 代码从 OpenOffice 2.4 迁移到 3.0

[英]Migrating Java UNO code from OpenOffice 2.4 to 3.0

I had a nifty small tool written to convert spreadsheets to plain text.我编写了一个漂亮的小工具来将电子表格转换为纯文本。 Since it was my private hacker tool, it relied on OpenOffice 2.x to read the files.由于它是我的私人黑客工具,它依赖于 OpenOffice 2.x 来读取文件。

But when I installed OpenOffice 3 and tried to get it get it to run, I failed miserably, because I'm either missing some JAR files or half the classes have been replaced.但是当我安装OpenOffice 3并试图让它运行时,我失败了,因为我要么丢失了一些 JAR 文件,要么已经替换了一半的类。

I'm including all five JAR files from URE/Java (URE: UNO Runtime Environment, a subset of OpenOffice.org hosting and managing UNO components) and am still missing these classes:我包含来自 URE/Java 的所有五个 JAR 文件(URE: UNO运行时环境,OpenOffice.org 托管和管理 UNO 组件的一个子集),但仍然缺少这些类:

com.sun.star.frame.XComponentLoader
com.sun.star.frame.XController
com.sun.star.frame.XDesktop
com.sun.star.frame.XModel
com.sun.star.frame.XStorable
com.sun.star.sheet.XSpreadsheet
com.sun.star.sheet.XSpreadsheetDocument
com.sun.star.sheet.XSpreadsheetView
com.sun.star.text.XTextDocument

Any pointers?任何指针?

I found what I was missing.我找到了我缺少的东西。

I had to include the following jars我必须包括以下罐子

URE/java/juh.jar
URE/java/jurt.jar
URE/java/ridl.jar
Basis/program/classes/unoil.jar  

The last one I was missing before - note the German OOo version .我之前遗漏的最后一个 -请注意德语 OOo 版本

And, something I didn't have to do before, I had to include the path to the OOo executables, eg而且,我以前不必做的事情,我必须包含 OOo 可执行文件的路径,例如

c:/program/OpenOffice.org 3/program/

After that and without changing code it worked just like before.在那之后,没有改变代码,它就像以前一样工作。

So, Brian, UNO's API is stable even between major releases.所以,Brian,即使在主要版本之间,UNO 的 API 也是稳定的。 It was just the classpath I had to fix.这只是我必须修复的类路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将弹性搜索从 1.4.3 迁移到 2.4 java 代码 - Migrating elastic search from 1.4.3 to 2.4 java code 如何从Java Uno应用程序关闭OpenOffice? - How to shutdown OpenOffice from my Java Uno application? 将Java Play从2.3迁移到2.4时出错 - While migrating Java play from 2.3 to 2.4 getting error Java OpenOffice UNO API:如何扩展电子表格文档? - Java OpenOffice UNO API: How to scale spreadsheet document? 使用Openoffice Java API(UNO API)将整个ODT(Openoffice Writer)文档部分复制到其他文档 - Copy a whole ODT (Openoffice Writer) document section to other document with Openoffice Java API (UNO API) 游戏UNO java代码设计 - the game UNO java code design Playframework从2.4迁移到2.5:java.lang.IllegalStateException:试图调用materialize() - Playframework migrating from 2.4 to 2.5 : java.lang.IllegalStateException: Attempted to call materialize() 将BCD转换代码从Java迁移到.Net - Migrating BCD conversion code from Java to .Net 如何将OpenOffice.org作为后台进程运行,以便将我的应用程序连接到使用UNO Java API? - How do I run OpenOffice.org as a background process for connecting my application to using the UNO Java API? 使用Java将UNO添加到OpenOffice文本文档中的按钮,文本字段,复选框等 - Adding buttons, textfields, checkboxes etc. to an OpenOffice textdocument usind UNO with Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM