Premise: I have had 2 classes loaded by different class loaders – one from the app classloader and the other, a custom class loader. The class loaded by the custom class loader is trying to reflectively access a private field in the class loaded via the appclass loader. In this case, I get a runtime err…
Tag: java-platform-module-system
jdeps can’t print-module-deps due to a MultiReleaseException
We have a JavaFX based application which is not modularized (there are reasons, a legacy library is involved) but we build an custom runtime using jdeps and jlink. We’ve recently rewritten the app and added a couple of new dependencies, as well as removing others. Now the script that is building the app…
Unable to make field final transient java.lang.Class java.util.EnumSet.elementType accessible: module java.base does not “opens java.util” to unnamed
I get this error when I run this test using JDK 17: I tried adding this to my pom.xml based on other answers: But when I build, I now get this error: Answer @Holger is right, you should not hack into JDK internals. He also explained correctly that –add-opens is not a valid Maven Compiler option. Because…
Can JavaFX realistically be used in a non-modular environment?
I’ve attempted to use JavaFX by following instructions found at: https://openjfx.io/openjfx-docs/ under “JavaFX and IntelliJ” -> “Non-modular with Maven” After completing steps 1 & 2 (Installation & Verification) I attempted to run a very simple program from IntelliJ r…
org.json cannot be resolved to a module?
I’m learning Java. To read JSON in my application, I downloaded this JSON library; which is an automatic module. I included that library in my module descriptor like: My settings.json in vscode: How do I include the jar file in my module and import it into my Java file? Screenshot: Answer TL;DR — As thi…
gradle Jigsaw module not found
I try to run a very simple gradle project which uses java 9 modules, but i receive the following error. Here is it https://github.com/vad0/test_modules. The main class does basically nothing. It uses only one dependency: HdrHistogram. I included this magic command in build.gradle according to official gradle …
How to resolve conflict between JPMS and OSGi Bundle for Eclipse plugin project an Tycho
I am working on an Eclipse based project that recently switched from Java 1.8 to Java 11. Due to that we have now a conflict between classes from the JRE and classes that are introduced from Eclipse plugin dependencies. So the java.xml.* classes are now present twice. once from the module java.xml and once du…
Lucene split package: module reads package ‘org.apache.lucene.analysis.standard’ from both ‘lucene.analyzers.common’ and ‘lucene.core’
Given my module-info.java: I get the following error: Module ‘my_module’ reads package ‘org.apache.lucene.analysis.standard’ from both ‘lucene.analyzers.common’ and ‘lucene.core’ In my code I use the following imports: How can resolve this split package problem?…
Package accessible from more than one module:
When trying to register an MBean in JMX Console I’m getting the following error message: I’m using Eclipse and I have no module-info.java file in my project structure. The error disappear when I comment my dependency for Java EE API, but the javax.management package is not part of the JAR. Answer
Eclipse issue with java 9 and maven
I installed Version: Oxygen.1a Release (4.7.1a) Build id: 20171005-1200 supporting Java 9. With suggested configuratio on eclipse.ini I have developed by java 9 (java 9 modularity) code project to test dependency injection as pure Java prject from eclipse, but when I have integrated Maven running my from ecli…