Skip to content
Advertisement

How to “require” module “gwt.user” On Java, JDK17, “module-info.java”, Netbeans, Maven

I am trying to keep up with the new changes in Java, one step a time.
I am updating my old libraries with module-info.java files.
I have a very simple project named “api-clone” dependent on “gwt-user”.
pom.xml:

JavaScript

With the module-info.java below:

JavaScript

When netbeans runs compile, it builds successfully:

JavaScript

However, when I look at the module-info.java file, Netbeans show error: enter image description here

  • Is it because “gwt.user” is not a module-ized project?
  • How to handle that kind of projects, when ones projects are dependent on them?

Advertisement

Answer

As @skomisa answered, the problem I am facing in “module-info.java”
can be solved in “pom.xml” by adding exclusion on dependecy tag.

JavaScript

USEFUL VIDEO: https://www.youtube.com/watch?v=xKmv24_2Asw&t=2094s

example code: at github

Advertisement