Questions tagged [java-module]
Refers to the module as defined by the module system in java introduced in Java 9. Hence likely to be coupled with the [java-9] (or above) tag.
677
questions
0
votes
0
answers
31
views
Unknown Java maven compilation error: R1549aadb
Whilst modularizing and migrating a Java 8 project to Java 17 an unknown maven error has been encountered.
The project has non-modular dependencies.
The regular classes and test classes (JUnit5) ...
4
votes
2
answers
67
views
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 ...
3
votes
0
answers
25
views
jmod: "Error: module-info.class not found" despite it existing in the jar file
Attempting to create a .mod file from a jar file.
$JAVA_HOME/bin/jmod create --class-path ./bouncycastle/bcprov-jdk18on-171.jar bouncycastle.mod
results in:
Error: module-info.class not found
java....
0
votes
0
answers
34
views
Does java -jar command involve java platform module system
I am new to JPMS, I know that if a modular jar is put on classpath then it will be treated as normal jar by jvm at run time. But if I am executing a executable modular jar using java -jar command,
...
1
vote
2
answers
35
views
How JPMS decide root modules at runtime
I am new to java module system. I am trying to understand how JPMS decide the root modules to build the module graph at runtime.
What I understand is that all modules in the module path will be added ...
0
votes
0
answers
55
views
How to get service of concrete Module in JPMS?
I have a dynamically created layer that has about 25 modules. About 7-10 modules can provide com.foo.Bar service. I need to get a service of concrete module - I have a reference to Module. Could ...
0
votes
0
answers
22
views
Is there a way to bypass problem of package split in java automatic modules when we're not in charge of included code
I have a custom library for creating requests to Apache Druid database which I would like to turn into java modules.
My library includes dependencies:
org.apache.druid:druid-processing:0.22.1
org....
3
votes
1
answer
73
views
IllegalAccessException when accessing ZoneInfo via JSF/EL with JDK 17
While porting a big JEE8 application to Java 17, I stumbled upon an IllegalAccessException when rendering a simple EL expression: #{myWarBean.defaultTZ.rawOffset}. I managed to reproduce the problem ...
0
votes
1
answer
25
views
Referencing external JAR from JavaFX Project
I'm trying to reference a set of APIs from my JavaFX project:
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs....
0
votes
0
answers
40
views
javafx exporting modules [duplicate]
I'm trying to create a preloader for my javafx application, but I'm stuck with these exceptions :
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/...
1
vote
1
answer
45
views
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 ...
0
votes
0
answers
15
views
Unable access mqrtt library from my another module to main App module
I created another module from my mqrtt client but unable to access mrqtt library methods
for example :- Unable to access MqrttMessage method?
you can see in above picture
Please tell what I am doing ...
0
votes
1
answer
62
views
How to break down a Java Micronaut application into multiple java modules?
I am from .net background and new to java. I have started exploring java micronaut framework and started building a mid size application using it. I want to break down functionality into following ...
0
votes
1
answer
52
views
Spring Boot implementation as Java9/Jigsaw Module
I have created a simple Spring Boot Interceptor class with a Config class to add that interceptor to the list of interceptors. This is inside a module of a project.
This is managed through Maven and ...
3
votes
1
answer
179
views
java module access issue: "Class in a module cannot access class in unnamed module because module x does not read unnamed module y"
My source code compiles on java 7 and runs on java 11.
I am trying to integrate imperva RASP as a java agent in tomcat. However, when I start the tomcat server, it is throwing following exception:
...
1
vote
1
answer
41
views
Java 9+ get module information by annotated module-info
I created custom annotation named ModuleDescription like this :
@Target(ElementType.MODULE)
public @interface ModuleDescription {
String name();
double version();
String description();
} ...
-1
votes
1
answer
59
views
Can´t run JavaFX application outside ide
I want run JavaFX application with module but dont know how to do. I tried several times but i never got it. I use Eclipse, and export the proyect with the first selected option.
Image
module ...
0
votes
0
answers
23
views
How to get IClassFileReader object from java 9+ modules file?
Until java 8, this code does it:
ToolFactory.createDefaultClassFileReader(sPath, sEntryPath, IClassFileReader.ALL);
where sPath is jar path and sEntryPath is entry to class name.
From java 9+(e.g. ...
0
votes
1
answer
89
views
The POM for [groupId]:domain:jar:1.0-SNAPSHOT is missing, no dependency information available
I am trying to build my module usecases with dependensy to my another module domain.
this is how project structure look like
domain's pom.xml
<groupId>com.darkyver.schedule</groupId>
<...
0
votes
0
answers
66
views
How do I use a legacy jar file with an automatic-module-name in Java?
Assume that a legacy jar file x.jar has an automatic-module-name com.foo.mymodule defined for it in its manifest file. Also, I want to use it in my application that uses modules.
The below is how I ...
2
votes
1
answer
184
views
Are there any JDK 11+ system modules which are not root modules?
In JDKs 9 and 10, there used to be a few modules such as java.xml.bind, containing Java EE classes. They were marked as deprecated and to be removed with the advent of JDK 9 and finally removed in 11 (...
1
vote
0
answers
123
views
RMI Server - module RMIServer does not "exports Server" to module java.rmi
Here is the interface
package Server;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface RmiSomme extends Remote{
public abstract void getInformation(String nom, ...
0
votes
1
answer
68
views
Modules, Gradle Subprojects, and IntelliJ Woes?
I am trying to make use of modules and gradle subprojects and either receive compile time errors or complaints from IntelliJ.
My project structure is as follows:
Root
- settings.gradle
- core
- ...
0
votes
1
answer
232
views
java.lang.RuntimeException: Unable to parse --add-opens
When building mailclient java module through gradle build i get the following error in the :test task
Task :test FAILED
Error occurred during initialization of boot layer
java.lang.RuntimeException: ...
0
votes
1
answer
204
views
Lombok and module-info.java
I am converting an existing Java library to use module-info.java. I use Lombok and generics extensively. When I run "mvn package" I get a ton of errors that follow this pattern:
[ERROR] /...
0
votes
0
answers
77
views
Java module dependencies and testImplementation dependencies
I apologise if this is a duplicate - a link to another answer would be great, but I am having difficulty knowing what to search for.
I am building a library (kotlin, but I can jump between kotlin and ...
5
votes
1
answer
150
views
Why doesn't the runtime image (assembled by jlink) for my JavaFX application launch and work correctly?
I have a simple JavaFX web browser that is a module. The directory structure of the module is:
webBrowser
webBrowser/module-info.java
webBrowser/webbrowser
webBrowser/webbrowser/WebBrowser.java
Here ...
0
votes
1
answer
123
views
AspectJ (ajc) with Modules
I am using AspectJ 1.9.7 and I am trying to compile a modular application with ajc. Let's suppose I have a single module called test and the following tree:
.
└── test
├── aspectj
│ ├── Main....
1
vote
0
answers
249
views
How do I know in Java 17 which library is still relying on -add-opens or if I can remove it?
We recently moved to Java 17. For a few libraries we had to add "--add-opens" parameter to open java internal classes for reflection calls. We wanna get rid of those once Java 17 is widely ...
1
vote
1
answer
95
views
NoSuchBeanDefinitionException / UnsatisfiedDependencyException when testing Spring Boot app with Java modules
How can I mitigate that the NoSuchBeanDefinitionException and the related UnsatisfiedDependencyException occur when testing a multimode Spring Boot app that has been configured with Java 9 modules?
...
1
vote
1
answer
146
views
How do I include src/test/java files to run TestNG tests?
I'm just learning Java and could use your help. I'm using Eclipse, and created a Maven project using the org.openjfx archetype. Everything seems to work fine except when I try to write tests in src/...
6
votes
1
answer
161
views
Find the missing module
My question: when building a minimal JRE, how can one make sure that no required module is missing?
To illustrate the question, here is an example where I want to build a minimal JRE for my project. ...
3
votes
0
answers
246
views
How can I configure sonar-maven-plugin to accept Java 9 module-info.java files?
How can I configure sonar-maven-plugin in my parent pom to accept (or ignore) Java 9 module-info.java files?
After adding module-info.java files to my Maven multi module project our mvn sonar:sonar ...
3
votes
1
answer
185
views
Compilation failure: "cannot find symbol" when applying module-info.java in multi module Maven project?
Please disregard this question. For unknown reasons, the project started working when I took a second look at it. After reading this page in the Stack Overflow question I opt to Close it (instead of ...
3
votes
0
answers
80
views
Can a reflection library that uses Java's module system access non modularized code?
I'm currently writing a library that uses reflection to access among other things the private fields of a class. Users are expected to use it in a way like Library.function(Class<?> cls);
I'm ...
0
votes
0
answers
98
views
How secure is module-info.java?
I'm just thinking how secure is the module-info.java , for example lets say if the library provider has added some restriction and opens only few service classes for the consumers.
I believe the ...
0
votes
0
answers
244
views
What do I need to do to get modules found in my module-info.java file in Java 17 while using the newest version of Maven and Spring boot
Currently I am trying to upgrade our project to Java 17. But because we need to use "javax.smartcardio" we need to add it as a module, as I have learned that the dependency has been removed. ...
0
votes
1
answer
128
views
How to copy module ('com.intellij.modules.java') integrated into Intellij to other JetBrain's product?
After downloading and importing plugin "Fortify Analysis" to IntelliJ ewerything is working, but when I try to do the same plugin into e.g. PyCharm I see error message like that:
In ...
2
votes
2
answers
244
views
Java instrumentation with modules
I am trying to run a javaagent in a modular application, but I cannot make it work from command line. I have created the smallest repository possible:
.
├── Makefile
├── manifest
└── mods
├── main
...
1
vote
0
answers
56
views
jlink compression plugin performance penalty
What is the performance penalty like for using the compression plugin to create a smaller java runtime image? I know it exists but testing separate builds of my application I could find no perceptible ...
0
votes
0
answers
30
views
Adding a new folder to Java module-path at runtime
I am wondering if it is possible to add new folders to module-path at runtime. Say we have this example. We run the program with
--module-path core
and then later during runtime, we want to add the ...
0
votes
2
answers
167
views
how to add the JDBC API in eclipse IDE
I want establish a connection with a MySQL database. I downloaded JDBC from the official website of MySQL, and I added the jar file to my Eclipse IDE. However, when I tried to import java.sql package, ...
3
votes
1
answer
125
views
Java Module-Info 'Uses' Directive (Service Consumption)
I'm using one of the new random generator algorithms (https://openjdk.java.net/jeps/356):
RandomGeneratorFactory.of("L128X1024MixRandom").create().nextDouble();
And it works.
Except after ...
0
votes
0
answers
51
views
How to run Eclipse Javadoc when a module project depends on another module project?
I got Eclipse 2021-06 Javadoc to work with JavaFX using the module-path and add-module JVM arguments (see "Module not found" message when generating JavaDocs in Eclipse), but I cannot get it ...
0
votes
0
answers
264
views
Gradle automatic module dependency
tldr: gradle x java library without a module-info.class
I have a Gradle project in which i'd like to use the Java JOL library, so i added the following to the build.gradle file:
dependencies {
...
0
votes
0
answers
60
views
What is the module in java for org.apache.tomcat-embed-core?
Hello I am using Spring tools suite and I got this error in the image because of I tried to add a module that has javax.servlet package:
Thanks in advance
2
votes
0
answers
93
views
Java ModuleDescriptor.Builder: whats the purpose?
Using ModuleDescriptor.Builder I can build ModuleDescriptors. I can also read ModuleDescriptors from files. The only thing missing now is Writing ModuleDescriptors to files.
After building my ...
3
votes
1
answer
108
views
java ModuleLayer : ModuleLayer.Controller add methods don't work
I am using Netbeans 12.5 and java 16
In an Java Modular Project I have 2 Modules
Modular-Testing(/*The Project Name*/)
|
|----Consumer(/*Module Name*/)
| |
|--classes(/*Folder Name*/)
|...
2
votes
0
answers
88
views
JVM flag for opening whole module at runtime in Java 17
I'm looking for a way to open a whole module in Java 17 not a specific package and I'm looking for a JVM flag such as --add-opens. I do not have access to the module and thus cannot modify the module-...
0
votes
0
answers
67
views
How to make Netbeans recognize java.sql module
Netbeans (Apache NetBeans IDE 11.0 ) seems to not "see" the java.sql module (which is standard part of the JDK); this prevents me from doing normal things live viewing the javadoc, looking ...