0

How can i load resources in a Netbeans (12.3)Java modular project? And where can i put te resources folder?

If you look in te New project wizard, there are no modular project with Maven, so i created an Ant project.

I have created a test project, called Resources, with a module test The goal of Java modules is to control it own resources, so i create the resources folder in the test module.

The directory structure of the test module:

test

  • classes
  • resources
  • tests

But the resources directory is not visible in Netbeans itself. If you go to project settings / sources you can add folders to sources, it won't work either: enter image description here

The resources folder must in the module folder because every module becomes a jar file. How can i solve this?

amnesiac
  • 21
  • 5

1 Answers1

0

I have found it!

A good explanation: Loading classes and resources in Java 9

You must put the resources module in the classes directory The recourses folder appears in Netbeans and can be loaded in the application (if the resources is openend in module-info.java)

amnesiac
  • 21
  • 5