SWriter.java & DocumentLoader.java

Miklos Vajna vmiklos at suse.cz
Mon Aug 12 00:35:17 PDT 2013


Hi Ahmed,

On Fri, Aug 09, 2013 at 04:02:21PM +0200, Ahmed Hasnaoui <hasnaoui.ahmed90 at gmail.com> wrote:
> I just tested some of the SDK examples (to find here:
> http://api.libreoffice.org/examples/java) but especially the SWriter.java
> and the DocumentHanlder.java.
> 
> In Netbeans the SWriter.java runs well, the DocumentHandler.java has no
> proper Main() to run it in Netbeans directly.

The SDK examples come with a Makefile, use that first, instead of any
Java IDE.

> My Problem is now, I created a jar of the SWriter.java and run it in cmd,
> but get this error:
> 
> *********************************************************************************************************
> 
> C:\Users\HasnaouiA\Documents\NetBeansProjects\SWriter\dist>java -jar
> SWriter.jar
> 
> com.sun.star.comp.helper.BootstrapException: no office executable found!
>         at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java:262)
>         at packSW.SWriter.main(SWriter.java:69)

Seems to work here. Here is what I did:

1) Set up the SDK:

http://api.libreoffice.org/docs/install.html

2) Build the directory you're interested in:

cd /path/to/sdk/examples/java/Text && make

3) Start LibreOffice in listening mode:

/path/to/soffice "--accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager"

4) Run the example:

make SWriter.run

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20130812/153a918b/attachment.pgp>


More information about the LibreOffice mailing list