Hello Harsha,

On Friday 10 December 2010, 19:18, Harsha Ravnikar wrote:
> Hi Ariel,
> 
> Thanks for your reply. I see that the latest version available is 3.3.0
> Release Candidate 7. If you are using version 3.4... are you  one of the
> developers?

well I don't dare to call myself that, so let's say I'm a community contributor.

> I have version 3.2 from Ubuntu repository. I believe that should be fine
> too.

yes, but with the SDK from Ubuntu's repos:

~$ sudo apt-get install openoffice.org-dev openoffice.org-dev-doc

> I had not tried TextReplace.java from the distribution. So I picked it from
> my local installation
> 
> /usr/lib/openoffice/basis3.2/sdk/examples/java/Text/TextReplace.java
> 
> created a plain java project in my NetBeans IDE. 

this is your main error. As I said before, you need the bootstrap glue code.

* Install the NetBeans OOo plug-in:
http://api.openoffice.org/files/documents/22/4772/org-openoffice-extensions-2.0.7.alpha.nbm

* set up your OOo installation
 Tools - Options - Miscellaneous . OOo API Plugin
In "OpenOffice.org Installation" browse to (and select)
/usr/lib/openoffice
or
/usr/lib64/openoffice
if you're on 64 bits system.

* create a project using the template in the category 
 OpenOffice.org - OpenOffice.org Client Application

you'll see that the generated project has a package folder named 
com.sun.star.lib.loader
You would have seen this already if you had downloaded
and played with the new version of the example I uploaded.

> Added the library
> "OpenOffice.org" which has the following jars:
> 
> /usr/lib/openoffice/basis3.2/ure-link/share/java/juh.jar
> /usr/lib/openoffice/basis3.2/ure-link/share/java/jurt.jar
> /usr/lib/openoffice/basis3.2/ure-link/share/java/ridl.jar
> /usr/lib/openoffice/basis3.2/program/classes/unoil.jar
> 
> 
> and compiled it, OK. When I run it (from IDE) I get the following
> Exception:
> 
> run:
> com.sun.star.comp.helper.BootstrapException: no office executable found!
>         at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java:246)
>         at TextReplace.main(TextReplace.java:64)
> BUILD SUCCESSFUL (total time: 3 seconds)

as already said, you need the bootstrap glue code (also, a good manifest, 
and if you try it on Win, the unowinreg.dll, etc).
Just follow the steps indicated above, and study the files generated by the 
NB plug-in (and look the contents of the generated jar, to get an idea of what 
is happening).

This compiled project runs even from the command line with:

$ cd TextReplace/dist/
$ java -jar TextReplace.jar 


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to