The Macro Documentation mentions these steps:
- Compile the HelloWorld.java file. The following jar files from the program/classes directory of a OpenOffice.org installation must be in the classpath: ridl.jar, unoil.jar, jurt.jar
- Create a HelloWorld.jar file containing the HelloWorld.class file
How would these steps be accomplished in IntelliJ IDEA (or even, for that matter, from the command line?)
My attempt below resulted in the following error when trying to run the macro.
- Add provided
HelloWorld.java
to./src
- Mark
./src
as Sources Root - Define Project compiler output path in Project Settings
- Add
juh.jar
,jurt.jar
,officebean.jar
,ridl.jar
, andunoil.jar
to Project Libraries - Add a JAR Artifact From modules with dependencies, no Main Class
- Remove LibreOffice .jar files from output (automatic behavior was to include them extracted, but I think that’s unnecessary since LibreOffice clearly already has a copy)
- Generate a manifest file
Error:
com.sun.star.uno.RuntimeException: [jni_uno bridge error] UNO calling Java method invoke: non-UNO exception occurred: java.lang.NullPointerException
java stack trace:
java.lang.NullPointerException
at sun.misc.Resource.getBytes(Resource.java:143)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:450)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.sun.star.script.framework.provider.java.ScriptImpl.invoke(ScriptProviderForJava.java:238)
My guess would be that this error is indicating that the HelloWorld
class was not found in the JAR.
What steps are missing? Or what might I need to do in order to further diagnose the problem?