540 questions
5
votes
1
answer
76
views
Why can't java find the module that I created and compiled?
My directory looks like this. I am just outside of the blah folder.
$ tree.com //F
Folder PATH listing for volume Acer
Volume serial number is 127C-AD6A
C:.
└───blah
└───src
└───main
...
4
votes
3
answers
350
views
How to combine multiple Java modules into one JAR?
The goal:
to combine multiple JARs and the modules in them into a single JAR
allow consumers to include a single package dependency in their maven/gradle/... files
make all of the modules available ...
1
vote
2
answers
111
views
What are the real-world use cases for java.lang.Module#addOpens(String, Module)?
I am familiar with the Java Platform Module System.
The javadoc for Module#addOpens sketches out a use case that I cannot translate into the real world:
This method can be used for cases where a ...
2
votes
1
answer
98
views
What arrows to use in component diagrams to show relations between JPMS layers?
JPMS supports multiple layers. For example boot layer and its two child layers.
And I need to show these layers on UML diagram. For this I selected component diagram where every layer is a component. ...
0
votes
0
answers
121
views
Transform simple FO file to PDF using fop 2.10 and JPMS
I did an example that you may clone by
git clone https://github.com/rolfschumacher/chFop.git
Importing it to Eclipse as an existing Maven project and let it run leads to
Unable to derive module ...
1
vote
0
answers
55
views
compiler:testCompile puts all transitive dependencies on module path
I added a module.info to my src/main/java and then also to my src/test/java, as per the example here. Compiling my main code is no problem. I see the compiler:compile goal adds only my direct (non-...
2
votes
1
answer
404
views
How to fix java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine in java 21
I've a clojure project with deps.edn which uses the library clj-async-profiler
My main function in the project contains the below code -
(ns com.myns.cli
(:gen-class)
(:require
[clj-async-...
0
votes
0
answers
42
views
Why does a module has to provide the imports for required static references?
I am migrating my Web project into java modules (JigSaw) with Java 17 and eclipse. One of my projects (ProjectA) defines Lombok as a required static resource ("requires static lombok;") in ...
1
vote
0
answers
170
views
spring jpms module exited
anyone can explain to me why my spring jpms module exited ?
my code is too simple :
package ir.moke.module.spring;
import org.springframework.boot.SpringApplication;
import org.springframework.boot....
0
votes
2
answers
136
views
Tomcat JPMS error jakarta.security.auth.message
I try to build jpms embedded tomcat server .
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</...
0
votes
1
answer
472
views
Cannot Export/Open Package from Module jdk.compiler to Run/Pass Tests in Maven
Settings
I'm using JDK 22:
openjdk version "22" 2024-03-19
OpenJDK Runtime Environment (build 22+36-2370)
OpenJDK 64-Bit Server VM (build 22+36-2370, mixed mode, sharing)
I'm also using ...
2
votes
1
answer
136
views
Java cannot find class in modular jar file, yet javap can
I have a simple hello world that I'm trying to build into a modular jar to test running jlink. I can neither run the jar file nor can I create an image for it with jlink.
I an on Windows, and using ...
1
vote
0
answers
131
views
Do I still need maven dependencies when using JPMS modules?
I don't fully understand the combination of JPMS and maven. In multiple places, the two claim to be independent and orthogonal to each other, yet both offer concepts for dependency and encapsulation.
...
2
votes
0
answers
134
views
Maven JPMS without test-scoped dependencies
Having a maven project "Test".
This is the pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
...
4
votes
0
answers
98
views
Are JPMS modifiers `static` and `transitive` incompatible?
The JPMS requires instruction can have two qualifiers static and transitive. For a module foo:
requires static bar;, makes resolution of the bar module optional at runtime,
requires transitive bar;, ...
1
vote
1
answer
2k
views
ClassNotFoundException: org.apache.logging.log4j.Logger
In my Java 17 maven project I am using slf4j based on log4j2. It runs fine, when I start it from within Eclipse.
Maven places the main class in MANIFEST of the modules jar file and all dependent jar ...
0
votes
0
answers
199
views
how to set the compiler option --patch-modules in eclipse
I am using JDK 19 in a modular maven project.
My project compiles in the shell, but I get errors in Eclipse.
The package org.slf4j is accessible from more than one module: <unnamed>, org.slf4j
...
0
votes
1
answer
399
views
DNSJava 2.1.8 as dependency invalidates JPMS (Java 9 Platform Module System) compatibility
There is a maven artifact called xxx:
Having this vanilla pom:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
...
0
votes
0
answers
75
views
Java JPMS project : package (JAXB) is not visible
I am creating my first project using JPMS . Simply I have a Maven project and some simple classes that need JAXB classes.Then
created module-info.java
module mymodule{
requires jakarta.xml.bind;
...
2
votes
1
answer
510
views
ModuleLayer can't find my resources when running my modular program, but it can for my modular jar
I have the following project structure.
ProjectName
|
|---src
|
|---main
|
|---java
| |
| |---ModuleName
| |
| |---module-info....
4
votes
1
answer
13k
views
Applying --add-opens Option to Dynamically Loaded Modules in Java 17
In the context of JEP 403's robust encapsulation in Java 17, I have a class (.jar) that is dynamically loaded during JVM execution.
This class utilizes Reflection to invoke private methods belonging ...
1
vote
1
answer
216
views
Maven project: module not found even with correct dependencies
I'm trying to build a Java module with Maven but I keep getting the same error (module not found) with every dependency when I run mvn compile. Neither Intellij IDEA nor VSCode give me any error ...
2
votes
1
answer
753
views
Error message mentions Java 9 even though I am using Java 11
I have a Java 11 Gradle project for work. I am using IntelliJ Idea. I have some test errors, so I'm trying to debug. The error message I'm asking about appears to be unrelated to the test errors, but ...
0
votes
0
answers
76
views
source compilation errors for openliberty and JPMS
Does anybody else experience strange Source compilation had errors info messages when running an application with JPMS modules on openliberty. These are info messages I also see in my project:
...\src\...
4
votes
0
answers
942
views
Usage Java module system for Kotlin project
In our purely Kotlin project we would like to use flexible Java 9 module system. Otherwise we have to use internal visibility modifier too often to hide internal Kotlin module functionality from other ...