Skip to content
Advertisement

Java warning: [options] system modules path not set in conjunction with -source 11

This machine has had multiple version of Java JDK installed and multiple version of multiple IDEs (Netbeans, IntelliJ, Eclipse, etc.) Most recently, I have added JDK 15.0.2 and Netbeans 12.2. When trying to compile a simple “Hello World”, this is the output that results:

ant -f C:\Data\NetBeans\grading\TestGrading -Dnb.internal.action.name=run.single -Djavac.includes=testgrading/HelloWorld.java -Drun.class=HelloWorld run-single

init:

Deleting: C:DataNetBeansgradingTestGradingbuildbuilt-jar.properties

deps-jar:

Updating property file: C:DataNetBeansgradingTestGradingbuildbuilt-jar.properties

Compiling 1 source file to C:DataNetBeansgradingTestGradingbuildclasses

**warning: [options] system modules path not set in conjunction with -source 11**

**1 warning**

compile-single:

run-single:

Hello World!

BUILD SUCCESSFUL (total time: 1 second)

As you can see, the file compiles and runs, but the warning is causing me concern. I have not been able to find a similar warning in my searches… (all of the warnings refer to “bootstrap class path not set” instead of “system modules path not set”

I have updated my Environment Variable to reflect the most current JDK with this entry: JAVA_HOME=C:Program FilesJavajdk-15.0.2

What setting am I missing that wasn’t properly updated as I’ve updated my JDK and my IDE? Or am I completely looking in the wrong places? Or do I need to fully uninstall previous versions and, if so, what will that do to previous code written using those previous versions that I’d still like to retain?

Thanks in advance!

Advertisement

Answer

I stumbled on the issue and the fix! While the new install changed the Java Platform in the Libraries properties to correctly point to JDK 15 as the new (Default), in the Sources area, towards the bottom, it left the Source/Binary Format still showing JDK 11. Changing this manually to JDK 15 made the warning go away. The warning message should have said something to the effect of “Source/Binary Format” does not match Library Java Platform – check corresponding versions.”

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement