Hi Wouter,
i would suggest that you use our NetBeans plugin and create a UNO client
application. build it and take a look into the generated jar file. You
will notice some glue code (coming with the SDK) and the manifest
entries Tobias has already described.
It can be really easy as long as you want to start a local office ;-)
And of course the NB plugin does that for you.
Juergen
Wouter van Reeven wrote:
Hi again,
On Thu, Feb 07, 2008 at 12:10:28PM +0100, To dev@api.openoffice.org wrote:
On Thu, Feb 07, 2008 at 12:05:56PM +0100, Tobias Krais wrote:
why not using this:
http://codesnippets.services.openoffice.org/Office/Office.BootstrapOpenOffice.snip
Because I am not using Windows but Linux :-) This solution probably works in
Windows, since the registry is searched for the OOo installation. There is no
such thing on Linux. If I want to use the Loader class I'd need to add
-Dcom.sun.star.lib.loader.unopath="/usr/lib/openoffice/program"
to the java command line. Any clue on how I may dynamically set the unopath?
Tobias, thanks so much for your help! I modified my app as follows:
private void myBootstrap() {
System.out.println("com.sun.star.lib.loader.unopath = \"" +
System.getProperty("com.sun.star.lib.loader.unopath") + "\"");
System.setProperty("com.sun.star.lib.loader.unopath",
"/usr/lib/openoffice/program");
System.out.println("com.sun.star.lib.loader.unopath = \"" +
System.getProperty("com.sun.star.lib.loader.unopath") + "\"");
System.out.println("java.class.path = \"" + System.getProperty("java.class.path") +
"\"");
System.out.println("java.library.path = \"" + System.getProperty("java.library.path")
+ "\"");
try {
Bootstrap.bootstrap();
} catch (Exception ex) {
Logger.getLogger(MyOOoBootstrapper.class.getName()).log(Level.SEVERE, null, ex);
}
}
and now running my app like this
java com.sun.star.lib.loader.Loader nl.reeven.van.test.ooo.MyOOoBootstrapper
suddenly does this
com.sun.star.lib.loader.unopath = "null"
com.sun.star.lib.loader.unopath = "/usr/lib/openoffice/program"
java.class.path =
"/usr/lib/openoffice/program/classes/juh.jar:/usr/lib/openoffice/program/classes/jurt.jar:/usr/lib/openoffice/program/classes/ridl.jar:/usr/lib/openoffice/program/classes/unoil.jar:/usr/lib/openoffice/sdk/classes:build/classes"
java.library.path =
"/usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.00/jre/../lib/i386:/usr/lib/openoffice/program:/usr/java/packages/lib/i386:/lib:/usr/lib"
I have to press CTRL-C to exit, which means that OOo is bootstrapped! Great
stuff! This means that setting the unopath like I do
System.setProperty("com.sun.star.lib.loader.unopath",
"/usr/lib/openoffice/program");
works! So, now I'm gonna try to get it to work without setting the classpath at
all like in Tobias' codesnippet.
Greets, Wouter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]