关于no office executable found!解决方法
来源:互联网 发布:js继承的几种方式比较 编辑:程序博客网 时间:2024/06/06 01:22
笔者写了一个简单新建swriter的代码
com.sun.star.uno.XComponentContext xContext = null;
try {
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
// get the rmeote service manger
com.sun.star.lang.XMultiComponentFactory xMCF =
xContext.getServiceManager();
// create a new instance of the desktop
Object oDesktop = xMCF.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext);
// get the component laoder from the desktop to create a new
// text document
com.sun.star.frame.XComponentLoader xCLoader =
(com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(
com.sun.star.frame.XComponentLoader.class,oDesktop);
com.sun.star.beans.PropertyValue [] szEmptyArgs =
new com.sun.star.beans.PropertyValue [0];
String strDoc = "private:factory/swriter";
System.out.println("create new text document");
com.sun.star.lang.XComponent xComp = xCLoader.loadComponentFromURL(
strDoc, "_blank", 0, szEmptyArgs);
}
catch( Exception e) {
e.printStackTrace(System.err);
System.exit(1);
}
运行后会报错如下:
com.sun.star.comp.helper.BootstrapException: no office executable found!
解决方案如下:
第一步 下载bootstrapconnector.jar,链接地址为 http://user.services.openoffice.org/en/forum/download/file.php?id=836&sid=12df5c8cdc4d853aa8a6fc87071f922f
第二步 把下载好的bootstrapconnector.jar包放到你安装office后juh.jar的地方
第三步 修改相应的源代码
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();修改为:
String oooExeFolder = "C:/Program Files/NeoShineOffice 5/program/";
xContext = BootstrapSocketConnector.bootstrap(oooExeFolder);
之后的代码可以保持即可新建一篇字处理文档
- 关于no office executable found!解决方法
- solution “no office executable found!”
- no office executable found! error still exist after adding /openoffice.org3/program to classpath
- IOError: No wkhtmltopdf executable found: ""
- No executable found matching command "bower"
- No executable code found at line。。。
- intellij no executable code found at line
- Intellij IDEA 断点不可用 No executable code found
- Android studio No executable code found 断点不可用
- dotnet publish 发布错误 No executable found matching command "bower"
- IntelliJ下断点不可用 No executable code found
- Android studio No executable code found 断点一直不可用
- Intellij IDEA 断点不可用 No executable code found
- Intellij IDEA 断点不可用 No executable code found
- 关于No Launcher activity found!
- 关于VC6中调试时局部变量"no found"的解决方法
- SSH中关于WARN No appenders could be found for logger的解决方法
- 关于调试ARM遇到的:No Cortex-M Device found问题的解决方法
- Flex和Java整合
- py2exe error: python25.dll
- qt中配置文件的读取
- 3.1面向对象的概念
- 关于热区的一些
- 关于no office executable found!解决方法
- webservice示例
- Javascript的一些困惑
- TEX介绍
- 跨浏览器实现自定义事件处理
- 序列化与反序列化
- Javascript 中的大括号{}和中括号[]详解
- Flex和Java整合错误 [FaultEvent fault=[RPC Fault faultString="Send failed"
- MyEclipse:Address already in use