nachdem ich nun endlich mit Hilfe dieses Artikels geschafft habe, dass ich weder Probleme habe die .jar Dateien einzubinden noch die soffice Startdatei zu finden, stiess ich auf ein neues Problem.
Wenn ich in Eclipse folgenden Connection Test debugge:
Code: Alles auswählen
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import com.sun.star.uno.XComponentContext;
import de.myFirm.printer.util.MyBootstrap;
public class ConnectionTest {
private final static String OOoBASE = "/Applications/OpenOffice.org 2.0.app/Contents/MacOS/program";
public static void main(String[] args) {
System.out.println("START");
URLClassLoader loader = null;
URL[] jarList;
try {
jarList = new URL[] {
new File(OOoBASE).toURL()
};
loader = new URLClassLoader(jarList);
System.out.println("CREATED CLASSLOADER");
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
System.out.println("error");
}
try {
System.out.println("TRYING BOOTSTRAP");
XComponentContext xContext =
MyBootstrap.bootstrap(loader);
System.out.println("Connected to a running office.");
com.sun.star.lang.XMultiComponentFactory xMCF =
xContext.getServiceManager();
String available = (xMCF != null ? "available" : "not available");
System.out.println("remote ServiceManager is "+available);
} catch (java.lang.Exception e) {
e.printStackTrace();
System.out.println("error");
} finally {
System.out.println("ending");
System.exit(0);
}
}
}
Irgendwie schafft er also nicht, OOo zu starten. Ich kann mir denken, dass das mit der Umsetzung von X11 zu tun hat bzw daran, dass es ja erst mitgestartet werden muss.START
CREATED CLASSLOADER
TRYING BOOTSTRAP
CE> I18N: Operating system doesn't support locale ""
CE> /Applications/OpenOffice.org 2.0.app/Contents/MacOS/program/soffice.bin X11 error: Can't open display:
CE> Set DISPLAY environment variable, use -display option
CE> or check permissions of your X-Server
CE> (See "man X" resp. "man xhost" for details)
ending
Seltsam finde ich, dass er Augenscheinlich einen Error hat (kein Sprung in catch Block, im try gehts aber auch nicht weiter) aber er trotzdem noch den finally block durchlaeuft.
Hat jemand eine Ahnung wie ich das hinbekommen kann?
Ich wuerde gerne weiter unter OSX entwicklen.
MfG
Till Fischer[/quote][/code]