question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not throw exception for missing system modules that are "required static"

See original GitHub issue

Using update4j 1.4.2, I just got this error message when downloading a jar file:

java.lang.IllegalStateException: System module ‘jdk.jfr’ is missing from JVM image, required by ‘javafx.base’

When looking at the module using jmod, we are seeing this:

jmod describe javafx.base.jmod 
javafx.base
exports javafx.beans
exports javafx.beans.binding
exports javafx.beans.property
exports javafx.beans.property.adapter
exports javafx.beans.value
exports javafx.collections
exports javafx.collections.transformation
exports javafx.event
exports javafx.util
exports javafx.util.converter
requires java.base mandated
requires java.desktop
requires jdk.jfr static
qualified exports com.sun.javafx to javafx.controls javafx.fxml javafx.graphics javafx.swing
qualified exports com.sun.javafx.beans to javafx.controls javafx.fxml javafx.graphics
qualified exports com.sun.javafx.binding to javafx.controls javafx.graphics
qualified exports com.sun.javafx.collections to javafx.controls javafx.graphics javafx.media javafx.swing
qualified exports com.sun.javafx.event to javafx.controls javafx.graphics
qualified exports com.sun.javafx.logging to javafx.controls javafx.fxml javafx.graphics javafx.swing javafx.web
qualified exports com.sun.javafx.property to javafx.controls
qualified exports com.sun.javafx.reflect to javafx.fxml javafx.web
qualified exports com.sun.javafx.runtime to javafx.graphics
contains com.sun.javafx.logging.jfr
contains com.sun.javafx.property.adapter

The important line here is requires jdk.jfr static. As we can see, it is a “static” requirement. According to this article, “requires static” is used for compile-only dependencies:

  • At compile time, bar must be present or there will be an error. During compilation bar is readable by foo.
  • At run time, bar might be absent and that will cause neither error nor warning. If it is present, it is readable by foo.

So, I think update4j should not throw an exception in cases like these.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ChristianCiachcommented, Jul 24, 2019

Well, yeah, all my coworkers already know about update4j because I did an in-depth presentation about how the updater works. Other than that, I don’t have contacts to any other Java developers :p

1reaction
ChristianCiachcommented, Jul 23, 2019

Thanks again. I can confirm that the fix works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Exception is: InvalidOperationException - The current type ...
Exception is : InvalidOperationException - The current type, is an interface and cannot be constructed. Are you missing a type mapping? I have...
Read more >
The type initializer for '' threw an exception - CodeProject
I faced the Same error that is "System.TypeInitializationException". This error is raised due to Static constructor . Actually in my case i am ......
Read more >
Lombok not working with JDK 11 modules (Jigsaw) #1723
I'm using: Java 11 Lombok 1.18.4 (also tried 1.18.5 edge) Gradle 5.0 (also tried with 4.9) PS: I have requires static lombok in...
Read more >
Exception Class (System) - Microsoft Learn
A system failure is a run-time error that cannot be handled programmatically in a meaningful way. For example, any method can throw an...
Read more >
How to Handle the Incompatible Types Error in Java - Rollbar
This error implies that the Java compiler is unable to resolve a value assigned to a variable or returned by a method, because...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found