Location for shared java libraries

Post Reply
Doc Joe
Posts: 43
Joined: Thu Oct 29, 2020 7:53 pm

Location for shared java libraries

Post 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?
jclounge
Posts: 14
Joined: Fri Aug 06, 2021 5:19 am

Re: Location for shared java libraries

Post 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.
ColinP
Posts: 939
Joined: Mon Aug 03, 2020 7:46 pm

Re: Location for shared java libraries

Post 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.
Doc Joe
Posts: 43
Joined: Thu Oct 29, 2020 7:53 pm

Re: Location for shared java libraries

Post by Doc Joe »

Thank you!!!
Post Reply

Return to “Module Designer”