Description: When I try to execute a Java Macro which loads any other class despite the one first loaded by the URLClassLoader, I get a NoClassDefFound Error. I searched before filing this bug if it is already here. I could not find it, in case I overlooked it, my apologies. Steps to Reproduce: 1. Go to <LOInstall Folder>\share\Scripts\java 2. Duplicate directory HelloWorld, e. g. to HelloWorldTest 3. Open the new directory, in there is HelloWorld.java 4. Adapt HelloWorld.java as follows: package org.libreoffice.example.java_scripts; import com.sun.star.script.provider.XScriptContext; import com.sun.star.uno.UnoRuntime; import com.sun.star.text.XTextDocument; import com.sun.star.text.XTextRange; import com.sun.star.text.XText; /** * HelloWorld class * */ public class HelloWorld { public static void printHW(XScriptContext xSc) { // getting the text document object XTextDocument xtextdocument = (XTextDocument) UnoRuntime.queryInterface( XTextDocument.class, xSc.getDocument()); XText xText = xtextdocument.getText(); XTextRange xTextRange = xText.getEnd(); xTextRange.setString("Hello World (in Java)"); LoadMe lm = new LoadMe(); // the actual change xTextRange.setString("Test String: " + lm.getText()); }// printHW } 5. create a new java class file, LoadMe.java e. g. as follows: package org.libreoffice.example.java_scripts; public class LoadMe { public LoadMe() { } public String getText() { return "Success"; } } 6. Compile the java files, e. g. in a dos command window after changing to the right path: SET OOO=c:\progra~1\LibreOffice\program\classes SET OOOPATH=%OOO%\juh.jar;%OOO%\jurt.jar;%OOO%\ridl.jar;%OOO%\unoil.jar javac -cp "%OOOPATH%" LoadMe.java HelloWorld.java 7. create a new path in your current HelloWorldTest directory all of those subfolders have to be created according to the java package name of the created class files org\libreoffice\example\java_scripts 8. copy the class files created by compilation to org\libreoffice\example\java_scripts 9. Update the jar file with the new classes, e, g.: jar -cvf HelloWorld.jar org from the command window in the HelloWorldTest folder If everything is done right, the parcel descriptor should still fit. 10. Now start Writer 11. Go to Tools -> Macros -> Run Macro 12. Search the available macros HelloWorldTest in the LibreOffice list and execute it Actual Results: NoClassDefFoundError. I can debug until the point LoadMe is called, so HelloWorld is executed but LoadMe is not on the classpath. Expected Results: LoadMe is executed and the String in Writer changes from "Hello World (in Java)" to "Test String: Success" Reproducible: Always User Profile Reset: Yes Additional Info: The issue seems with ScriptProviderForJava.java
Is there a distinction between this bug and bug 145527? If not, then please mark one of them as a duplicate.
*** This bug has been marked as a duplicate of bug 145527 ***
(In reply to Michael Warner from comment #1) > Is there a distinction between this bug and bug 145527? If not, then please > mark one of them as a duplicate. Thanks for the hint. I added a comment about the java version used, somehow that must have reposted the bug, sorry for that. I hope that does not happen again now when I press save changes.