Page 1 of 1

Location for shared java libraries

Posted: Fri Sep 10, 2021 10:24 am
by Doc Joe
Hi folks,

I have a few common functions that I use across many modules. They basically deal with features of the NDLR hardware and act to constrain / error check CV inputs. I wish to place them all into a separate file to be included in each module.

However, I am unsure of which folder I should put that include file.

Can anyone provide me the details of where shared function libraries should be placed?

Re: Location for shared java libraries

Posted: Fri Sep 10, 2021 12:18 pm
by jclounge
Hi Doc Joe, I haven't used this functionality yet so maybe someone else will correct me, but it looks like you can add additional java files and jar files in the editor, in the module properties where you set the module name, etc.

Re: Location for shared java libraries

Posted: Fri Sep 10, 2021 6:27 pm
by ColinP
This took me a while to figure out.

You can create a folder called say DrJoe and place class files in it, say one is called ErrorHandler.java

I think you can place the folder anywhere handy but it's a long time ago when I set this up so aren't 100% sure.

Then in a module's project click on the module background to display the module's Properties pane.

Then click on the Additional Java Files Edit button.

Then click on the resulting dialog's + button.

Navigate to the DrJoe folder and select ErrorHandler.

Then in your main source file go to the [user imports] section and enter...

import drjoe.ErrorHandler;

You can then use the ErrorHandler class in your main source and at the top of the source editor there'll be a menu with [Module Source], ErrorHandler options enabling you to switch between files.

Re: Location for shared java libraries

Posted: Mon Sep 13, 2021 8:41 am
by Doc Joe
Thank you!!!