no office executable found! error still exist after adding /openoffice.org3/program to classpath

本文主要是介绍no office executable found! error still exist after adding /openoffice.org3/program to classpath,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

按照openoffice developer's guide,实现第一个openoffice 例子:FirstUnoContact,出现了如下错误,
能在
guide中指明
这个错误应该是很常见的了,guide中也给出了解决方案。
If you encounter a com.sun.star.comp.helper.BootstrapException
claiming "no office executable found!" you should add the path to the
OpenOffice.org program folder to the classpath (e.g. .../OpenOffice.org
3/program).

但是我一开始时,按照其所述,并没能解决问题。
另外也通过openoffice 的maillist询问解决办法,下面是邮件来往。

但是按照邮件中所做也没能解决问题。总共花了一天时间,不停的更改设置,最终解决了。
我用的IDE是Eclipse,解决问题的关键是做了如下设置:
在Eclipse中,点击Project->Properties在出来的属性设置对话框中,选择左侧的Java Build Path,然后在右边点击Libraries选项卡,
然后点击右侧的Add External Class Folder, 选择路径/usr/lib/openoffice.org3/program
我想guide中给出的解决方案中的含义吧,也即"add the path to the OpenOffice.org program folder to the classpath(e.g. .../OpenOffice.org3/program).
就是说把OpenOffice.org3/program的路径加到classpath中去。
我原来一直试图把这个路径加到/etc/profile, /etc/bashrc, /root/.bashrc(我以root身份登录),但总是不见效。
现在在Eclipse的project settings中直接指定OpenOffice.org3/program作为class folder,才起到了作用。


-------------------------------------------------------------------------------------------------------------------------------------
邮件:

Hi, Bernd, thanks for your two suggestions, but error still there.
According to your two suggestion, following is what I did
Firstly, I have added following setting in /etc/profile, /etc/bashrc, /root/.bashrc
export JAVA_HOME=/usr/java/jdk1.6.0_20
export
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:/usr/lib/openoffice.org3/program/
export PATH=.:$PATH:$JAVA_HOME/bin

Seondly, I run the program in Eclipse IDE, choose Run->Run as Java Application.
And In the Project-> Properties ->Java Build Path-> Libaries, there are JRE System
Library[Java SE 1.6]
and OpenOffice.org Libraries [SDK 3.2.1] which contains following jars:
unoil.jar /opt/openoffice.org/basis3.2/program/classes
juh.jar /usr/lib/openoffice.org/ure/share/java
jurt.jar /usr/lib/openoffice.org/ure/share/java
ridl.jar /usr/lib/openoffice.org/ure/share/java

any other ideas?
thanks.


On Jun 18, 2010 11:57 pm, Bernd Eilers wrote:
-----------------------------------------------------------------------------------

Hi xiaofeng,

well you did try to execute an "echo $CLASSPATH" in the shell and are
sure the setting done in /etc/profile is really still there and not
accidently being overwritten by some other code in $HOME/.bashrc for
example, did you?

Did you try to call the programm by using java from the commandline or
did you try to start it from within the IDE. If later is the case the
IDE has most likely its own java classpath settings for IDE projects
somewhere in the project settings which might override your CLASSPATH
environment variable setting.


Kind regards,
Bernd Eilers

xiaofeng08@iscas.ac.cn wrote:
> Hi, OO folks,
>
> I tried to run the FirstUnoContact example in the 'Getting Started' section of
> OpenOffice.org Developer's Guide, but got the common error:
>
> encounter a com.sun.star.comp.helper.BootstrapException claiming "no office
> executable found!"
>
> The solution gave in the guide is to add the path to the OpenOffice.org program
> folder to the classpath (e.g. .../OpenOffice.org 3/program/).
>
> I added /usr/lib/openoffice.org3/program at the end of my /etc/profile, like
following:
> export JAVA_HOME=/usr/java/jdk1.6.0_20
> export
> CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:/usr/lib/openoffice.org3/program/
> export PATH=.:$PATH:$JAVA_HOME/bin
>
> I logout and login again to enable the /etc/profile, but still got this error when I
> tried to run FirstUnoContact again.
>
> My platform is fedora 12, my IDE is eclipse, and I have done all the steps listed
> in the guide and every steps goes fine.
>
> So ,can anybody please give a suggestion?
>
> Thanks.

这篇关于no office executable found! error still exist after adding /openoffice.org3/program to classpath的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/337591

相关文章

C#实现将Office文档(Word/Excel/PDF/PPT)转为Markdown格式

《C#实现将Office文档(Word/Excel/PDF/PPT)转为Markdown格式》Markdown凭借简洁的语法、优良的可读性,以及对版本控制系统的高度兼容性,逐渐成为最受欢迎的文档格式... 目录为什么要将文档转换为 Markdown 格式使用工具将 Word 文档转换为 Markdown(.

Android实现在线预览office文档的示例详解

《Android实现在线预览office文档的示例详解》在移动端展示在线Office文档(如Word、Excel、PPT)是一项常见需求,这篇文章为大家重点介绍了两种方案的实现方法,希望对大家有一定的... 目录一、项目概述二、相关技术知识三、实现思路3.1 方案一:WebView + Office Onl

如何解决idea的Module:‘:app‘platform‘android-32‘not found.问题

《如何解决idea的Module:‘:app‘platform‘android-32‘notfound.问题》:本文主要介绍如何解决idea的Module:‘:app‘platform‘andr... 目录idea的Module:‘:app‘pwww.chinasem.cnlatform‘android-32

解决SpringBoot启动报错:Failed to load property source from location 'classpath:/application.yml'

《解决SpringBoot启动报错:Failedtoloadpropertysourcefromlocationclasspath:/application.yml问题》这篇文章主要介绍... 目录在启动SpringBoot项目时报如下错误原因可能是1.yml中语法错误2.yml文件格式是GBK总结在启动S

mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法

《mysql出现ERROR2003(HY000):Can‘tconnecttoMySQLserveron‘localhost‘(10061)的解决方法》本文主要介绍了mysql出现... 目录前言:第一步:第二步:第三步:总结:前言:当你想通过命令窗口想打开mysql时候发现提http://www.cpp

springboot报错Invalid bound statement (not found)的解决

《springboot报错Invalidboundstatement(notfound)的解决》本文主要介绍了springboot报错Invalidboundstatement(not... 目录一. 问题描述二.解决问题三. 添加配置项 四.其他的解决方案4.1 Mapper 接口与 XML 文件不匹配

Python实现Microsoft Office自动化的几种方式及对比详解

《Python实现MicrosoftOffice自动化的几种方式及对比详解》办公自动化是指利用现代化设备和技术,代替办公人员的部分手动或重复性业务活动,优质而高效地处理办公事务,实现对信息的高效利用... 目录一、基于COM接口的自动化(pywin32)二、独立文件操作库1. Word处理(python-d

Python自动化Office文档处理全攻略

《Python自动化Office文档处理全攻略》在日常办公中,处理Word、Excel和PDF等Office文档是再常见不过的任务,手动操作这些文档不仅耗时耗力,还容易出错,幸运的是,Python提供... 目录一、自动化处理Word文档1. 安装python-docx库2. 读取Word文档内容3. 修改

Anaconda 中遇到CondaHTTPError: HTTP 404 NOT FOUND for url的问题及解决办法

最近在跑一个开源项目遇到了以下问题,查了很多资料都大(抄)同(来)小(抄)异(去)的,解决不了根本问题,费了很大的劲终于得以解决,记录如下: 1、问题及过程: (myenv) D:\Workspace\python\XXXXX>conda install python=3.6.13 Solving environment: done.....Proceed ([y]/n)? yDownloa

jenkins 插件执行shell命令时,提示“Command not found”处理方法

首先提示找不到“Command not found,可能我们第一反应是查看目标机器是否已支持该命令,不过如果相信能找到这里来的朋友估计遇到的跟我一样,其实目标机器是没有问题的通过一些远程工具执行shell命令是可以执行。奇怪的就是通过jenkinsSSH插件无法执行,经一番折腾各种搜索发现是jenkins没有加载/etc/profile导致。 【解决办法】: 需要在jenkins调用shell脚