Skip to content
Advertisement

Tag: java-module

How to inspect jvm module contents from the command line?

I would like to inspect the contents of a resource file of a java module of my locally installed jvm from the command line. Based on a question about mime type support in a jvm I would like to see the contents of /sun/net/www/content-types.properties in module java.base of my locally installed jvm. However when scrolling through the files installed for

Split Packages: Java Modules vs Sealed Jars

Both Sealed Packages/Jars and the Java Module System disallow spliting packages across several jars. Does that mean that all packages contained within a Module are implicitly sealed? If not what does explicitly sealing the jar change? Answer Yes, packages within modules are always implicitly sealed. This is specified in the documentation of the Package class: A Package automatically defined for

How to deal with ResolutionException?

I’m trying to use Java Modules in my Spring Boot project and I’m getting the following exception: How can I solve this problem? Answer Try using JDK8 to run this code. It seems to be a compatability issue Edit: The root cause is that this package has been removed. (https://jcp.org/en/jsr/detail?id=305) from the standard JVM installation after java 8. Some of

how to pass –add-opens JDK module configuration to maven test

I’m upgrading java version in our production code from java 8 to java 11. I have to add the below JDK module configuration in the application java start command due to usage of third party libraries like flume, zookeeper etc. –add-opens java.base/java.lang=ALL-UNNAMED –add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED After adding this configuration and java application is starting fine. But when I run the tests

Could not load FFI provider when using module-info.java

my Linux Java application uses bluetooth devices. I use this library in order to communicate with bluez stack : https://github.com/hypfvieh/bluez-dbus. It worked very well until I added module-info.java to my client code. Suddenly I got this error: Exception in thread “main” java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider at jnr.ffi@2.1.15/jnr.ffi.provider.InvalidRuntime.newLoadError(InvalidRuntime.java:101) at jnr.ffi@2.1.15/jnr.ffi.provider.InvalidRuntime.findType(InvalidRuntime.java:42) at jnr.ffi@2.1.15/jnr.ffi.Struct$NumberField.(Struct.java:872) at jnr.ffi@2.1.15/jnr.ffi.Struct$Unsigned16.(Struct.java:1240) at jnr.unixsocket@0.33/jnr.unixsocket.SockAddrUnix$DefaultSockAddrUnix.(SockAddrUnix.java:209) at jnr.unixsocket@0.33/jnr.unixsocket.SockAddrUnix.create(SockAddrUnix.java:174)

How does ServiceLoader.load work with class loaders in JPMS?

I have two JPMS layers: Boot layer with module A loaded by ClassLoaders$AppClassLoader@4fca772d Child layer with module B that provides cervices and loaded by Loader@6b58b9e9 The parent classloader of Loader@6b58b9e9 is ClassLoaders$AppClassLoader@4fca772d. In module A I have the following code: However, the services of Module B are found only when context class loader is Loader@6b58b9e9 and not found when context

Gradle build – add module path

My question: How do I set a module path for gradle build? I’ve become comfortable working with Java modules from the command line. I do a frequent exercise in Powershell which results in these source files. appMod/module-info appMod/appPack.Entry greetMod/module-info greetMod/greetPack.Hello Since the appMod module requires greetMod, I compile and jar greetMod first. Then I compile and jar appMod, but as

java 10 gradle project : automatic module not found

I created a java 10 project with intelliJ, using gradle. I copied some stuff into it (some “AppFx” class using the library guava and javaFx, and a personal build.gradle file). I also added a module-info.java file in src/main/java with this content: in which grava is an automatic module. here is the relevant part of build.gradle: intelliJ can compile the project

Advertisement