Search code examples
javanetbeansmodule-path

How to build with module path in Netbeans


Currently when I build my Java programs in Netbeans it asks for a classpath and wants to build with a classpath. However, keeping with the growing modular focus of Java 9+ I would rather compile with a module path.

I would run the command javac ... --module-path *.java but have complex dependencies and so would prefer to build it in Netbeans if there is that option available?


Solution

    • Select your project in the Projects panel
    • Right click and select Properties from the context menu.
    • Select Libraries from the list of Categories
    • Click the various tabs (Compile, Run, etc...) to set ModulePath as required.