Location for shared java libraries

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

Location for shared java libraries

Post by Doc Joe » Fri Sep 10, 2021 10:24 am

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: 12
Joined: Fri Aug 06, 2021 5:19 am

Re: Location for shared java libraries

Post by jclounge » Fri Sep 10, 2021 12:18 pm

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: 200
Joined: Mon Aug 03, 2020 7:46 pm

Re: Location for shared java libraries

Post by ColinP » Fri Sep 10, 2021 6:27 pm

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: 42
Joined: Thu Oct 29, 2020 7:53 pm

Re: Location for shared java libraries

Post by Doc Joe » Mon Sep 13, 2021 8:41 am

Thank you!!!

Post Reply