Just came into contact with the module system of jdk 11, so how to deal with module-info.java?

I have an old SpringBoot project, which now runs on jdk11 and works normally, but will report the following error when the project starts:

  stackoverflow  found that module-info.java can be used to solve the 
problem. Now that I create a module-info.java file, do all modules need their own requires or open ? Even if I know what needs to be imported (and I don"t know what to import), it"s too much and unfriendly. Do you have any good ideas?

Project configuration:
SpringBoot: 2.1.1.RELEASE
Gradle: 5.1.1
Jdk: 11

Apr.16,2022

  • if you want to use module-info.java, you probably have to transform it to support JPMS as a whole.
  • because module java.base does not export jdk.internal.misc to unnamed module see this error report. Just give the open of jdk.internal.misc to unnamed module. You can add the compilerArgs parameter to maven compiler plugin
<compilerArgs>
    <arg>-J--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED</arg>        
</compilerArgs>

have you solved it, jdk12? I have also encountered this problem. How to solve it?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb02c4-22b0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb02c4-22b0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?