Controlling the classpath on Moneydance 2019

John Hillery's Avatar

John Hillery

01 Jan, 2019 09:38 PM

I am unable to load classes from external jars in my Moneydance extension that uses the LibreOffice Java API. The older version of Java with Moneydance 2017 allowed me to manipulate the classpath. How can I control the classpath used by my Java extension in Moneydance 2019?

  1. Support Staff 1 Posted by Sean Reilly on 01 Jan, 2019 09:59 PM

    Sean Reilly's Avatar

    Hi John,

    Can you tell me how you used to change the classpath in previous versions of Moneydance? I'm guessing the problem is that we're now using openjdk 11 which likely prohibits the changing of the classpath at runtime as a security feature. Can you not bundle the 3rd party jar files within your extension's mxt file?

    Thanks,

    Sean Reilly
    Developer, The Infinite Kind
    http://infinitekind.com

  2. 2 Posted by John Hillery on 02 Jan, 2019 01:52 AM

    John Hillery's Avatar

    With MD 2017, I cast the system class loader via (URLClassLoader) ClassLoader.getSystemClassLoader(). The newer JVM with MD 2019 uses a system class loader that cannot be cast to URLClassLoader, which has an addURL method I used to access the LibreOffice Java API.
    Yes, I can bundle the needed jar files -- not my first choice.

  3. 3 Posted by John Hillery on 08 Jan, 2019 10:30 PM

    John Hillery's Avatar

    I resolved this issue by bundling the LibreOffice Java API jar files as suggested. To deal with problems locating native code in this API, I now use a BootstrapSocketConnector from https://github.com/jeremysolarz/bootstrap-connector.git to connect to a running LibreOffice instance.

    A suggestion for the MD feature backlog would be support for adding jars to the Moneydance extension class loader's classpath.

  4. 4 Posted by kerwin on 18 Feb, 2019 10:58 PM

    kerwin's Avatar

    After purchasing, downloading and installing Moneydance 2019 last night, I was not able to run my python script using zxJDBC to connect to a database through driver from a jar file.

    Unlike John, I am not a sophisticated developer and was using a simple jpython script to dump data in mysql to provide me with very reporting in cubes. I unfortunately had to revert back to 2017 and have wasted money on an upgrade.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac