Codice: Seleziona tutto
$ java -version
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment (build 17.0.7+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.7+7-Debian-1deb12u1, mixed mode, sharing)
Codice: Seleziona tutto
./setsdkenv_unix
************************************************************************
*
* SDK environment is prepared for Linux
*
* SDK = /usr/lib/libreoffice/sdk
* Office = /usr/lib/libreoffice
* Make = /usr/bin
* Zip = /usr/bin
* cat = /usr/bin
* sed = /usr/bin
* C++ Compiler = /usr/bin
* Java = /usr
* SDK Output directory = /home/gino/libreoffice7.4_sdk
* Auto deployment = YES
*
************************************************************************
volevo provare a lanciare
Codice: Seleziona tutto
import com.sun.star.uno.UnoRuntime;
import com.sun.star.frame.XModel;
import com.sun.star.text.XTextDocument;
import com.sun.star.text.XTextRange;
import com.sun.star.text.XText;
import com.sun.star.script.provider.XScriptContext;
public class LO_HelloWorld {
public static void printHW(XScriptContext xScriptContext)
{
XModel xDocModel = xScriptContext.getDocument();
// getting the text document object
XTextDocument xtextdocument = (XTextDocument) UnoRuntime.queryInterface(
XTextDocument.class, xDocModel);
XText xText = xtextdocument.getText();
XTextRange xTextRange = xText.getEnd();
xTextRange.setString( "Hello World (in Java)" );
}
}
Codice: Seleziona tutto
javac -cp java_uno.jar:juh.jar:jurt.jar:ridl.jar:unoil.jar /home/gino/Scaricati/LO_HelloWorld.java
/home/gino/Scaricati/LO_HelloWorld.java:1: error: package com.sun.star.uno does not exist
import com.sun.star.uno.UnoRuntime;
^
/home/gino/Scaricati/LO_HelloWorld.java:2: error: package com.sun.star.frame does not exist
ho provato a copiare (e dare permessi) .jar nel percorso di LO_HelloWriter
... qualcuno sa trovare dove sbaglio?
grazie