I’ve installed Version 4.0.3.3 (Build ID: 0eaa50a932c8f2199a615e1eb30f7ac74279539) and its associated SDK on Windows 7 64-bit.
I’m unable to get the TextReplace.java example application to compile, as downloaded from
http://api.libreoffice.org/examples/examples.html#Java_examples
The following jar files are on the library path:
C:\Program Files (x86)\LibreOffice 4.0\URE\java\java_uno.jar
C:\Program Files (x86)\LibreOffice 4.0\URE\java\juh.jar
C:\Program Files (x86)\LibreOffice 4.0\URE\java\jurt.jar
C:\Program Files (x86)\LibreOffice 4.0\URE\java\ridl.jar
C:\Program Files (x86)\LibreOffice 4.0\URE\java\unoloader.jar
The first executable line gives a compiler error:
public static void main(String args[]) {
// You need the desktop to create a document
// The getDesktop method does the UNO bootstrapping, gets the
// remote servie manager and the desktop object.
com.sun.star.frame.XDesktop xDesktop = null; // <-- The compiler compains about this line
xDesktop = getDesktop();
The error message is “package com.sun.star.frame does not exist.”
I confirm that other, related packages do indeed exist. For example, I can successfully declare objects from classes in com.sun.star.uno.
Any help most appreciated.