tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/2271-controlling-the-classpath-on-moneydance-2019Infinite Kind: Discussion 2019-05-20T23:00:22Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/467373532019-01-01T21:38:39Z2019-01-01T21:38:39ZControlling the classpath on Moneydance 2019<div><p>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?</p></div>John Hillerytag:infinitekind.tenderapp.com,2009-01-14:Comment/467373532019-01-01T21:59:38Z2019-01-01T21:59:38ZControlling the classpath on Moneydance 2019<div><p>Hi John,</p>
<p>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?</p>
<p>Thanks,</p>
<p>Sean Reilly<br>
Developer, The Infinite Kind<br>
<a href="http://infinitekind.com">http://infinitekind.com</a></p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/467373532019-01-02T01:52:47Z2019-01-02T01:52:47ZControlling the classpath on Moneydance 2019<div><p>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.<br>
Yes, I can bundle the needed jar files -- not my first choice.</p></div>John Hillerytag:infinitekind.tenderapp.com,2009-01-14:Comment/467373532019-01-08T22:30:09Z2019-01-08T22:30:09ZControlling the classpath on Moneydance 2019<div><p>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 <a href="https://github.com/jeremysolarz/bootstrap-connector.git">https://github.com/jeremysolarz/bootstrap-connector.git</a> to connect to a running LibreOffice instance.</p>
<p>A suggestion for the MD feature backlog would be support for adding jars to the Moneydance extension class loader's classpath.</p></div>John Hillerytag:infinitekind.tenderapp.com,2009-01-14:Comment/467373532019-02-18T22:58:15Z2019-02-18T22:58:15ZControlling the classpath on Moneydance 2019<div><p>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.</p>
<p>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.</p></div>kerwin