module-info.java should contain "requires java.logging"
See original GitHub issueVersion 4.6.32
When I run new ClassGraph().verbose().scan()
under IntellJ IDEA I get:
Exception in thread "main" java.lang.IllegalAccessError: class nonapi.io.github.classgraph.utils.LogNode (in module io.github.classgraph) cannot access class java.util.logging.Logger (in module java.logging) because module io.github.classgraph does not read module java.logging
at io.github.classgraph@4.6.32/nonapi.io.github.classgraph.utils.LogNode.<clinit>(LogNode.java:51)
at io.github.classgraph@4.6.32/io.github.classgraph.ClassGraph.verbose(ClassGraph.java:103)
I believe adding requires java.logging
to your module-info.java
file will fix this problem.
Issue Analytics
- State:
- Created 5 years ago
- Comments:37 (15 by maintainers)
Top Results From Across the Web
package java.util.logging is not visible; Adding `requires java ...
I have a JPMS related issue. I am using JUL for my project and after doing a little google search I found out...
Read more >1.2. Declare modules and enable access between modules
To declare an application module, a module declaration needs to be specified. This is done in a special file called module-info.java . As...
Read more >Java Modules: a complete guide part 1 | by DV Singh - Medium
The module descriptor lives in a file called module-info.java. ... java.sql will now automatically be requiring java.logging and java.xml.
Read more >Java 9 - Modules
The javac compiler will transform the module-info.java into a module-info.class file containing the information from the source file. The class ...
Read more >Chapter 14. The Java Module System - Modern Java in Action
In the context of building software, requirements can change frequently. ... Alternatively, you could have written module-info.java as follows:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just verified the fix in
master
fixes the error in my application. Thank you!This is reasonable, but given that it is a
java.util
class, won’t it always be present in any JRE?And actually,
requires static
is not ideal. From: https://blog.codefx.org/java/module-system-optional-dependencies/