Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

package javax.jnlp is declared in module java.jnlp, which is not in the module graph

I have a project that uses Java webstart technology. I decided to upgrade the Java version from 8 to 9. However, I faced the following error on compiling:

error: package javax.jnlp is not visible
import javax.jnlp.DownloadServiceListener;
        ^
(package javax.jnlp is declared in module java.jnlp, which is not in the module graph)

I tried to include C:\Program Files\Java\jdk-9\lib\javaws.jar to the classpath, but still the same issue remains.

like image 511
Eng.Fouad Avatar asked Jul 31 '17 15:07

Eng.Fouad


1 Answers

It looks like java.jnlp is not resolved by default for code on the class path (much like Java EE modules). The solution is to add it explicitly with --add-modules java.jnlp (both javac and java accepts that parameter).

This option is discussed in JEP 261: Module System or in this blog post.

like image 66
Nicolai Parlog Avatar answered Nov 19 '22 00:11

Nicolai Parlog