Questions tagged [java-platform-module-system]

Project Jigsaw aims to design and implement a standard module system for the Java SE platform. It was released as part of Java 9.

Project Jigsaw is a sub-project of OpenJDK that aims to provide a standard module system for the Java SE platform. Originally targetted at Java 7 it was postponed first to Java 8 and more recently to Java 9.

Originally the scope of the project was to provide modularisation for the JDK itself. This scope has been expanded to make the module system part of the Java Platform.

The Jigsaw project is closely related to the Penrose Project that is looking at interoperability between Jigsaw and OSGi.

505 questions
239
votes
4 answers

What is an illegal reflective access?

There are a lot of questions about illegal reflective access in Java 9. I have found plenty of discussion about working around the error messages, but I would love to know what an illegal reflective access actually is. So my question is: What…
Tschallacka
  • 27,901
  • 14
  • 88
  • 133
212
votes
21 answers

How to solve InaccessibleObjectException ("Unable to make {member} accessible: module {A} does not 'opens {package}' to {B}") on Java 9?

This exception occurs in a wide variety of scenarios when running an application on Java 9. Certain libraries and frameworks (Spring, Hibernate, JAXB) are particularly prone to it. Here's an example from…
Nicolai Parlog
  • 47,972
  • 24
  • 125
  • 255
103
votes
2 answers

Is there any need to switch to modules when migrating to Java 9 or later?

We're currently migrating from Java 8 to Java 11. However, upgrading our services was less painful, than we anticipated. We basically only had to change the version number in our build.gradle file and the services were happily up and running. We…
Younes El Ouarti
  • 2,200
  • 2
  • 20
  • 31
100
votes
1 answer

What's the difference between --add-exports and --add-opens in Java 9?

Java 9 (jdk-9+170) does not allow by default an application to see all classes from the JDK, unlike all previous versions of Java, due to the new module system. To workaround this, the java command line offers a new argument --add-exports which…
94
votes
3 answers

OSGi, Java Modularity and Jigsaw

So as of yesterday morning I hadn't a clue as to what OSGi even was. OSGi was just some buzzword that I kept seeing cropping up over and over again, and so I finally set aside some time to brush up on it. It actually seems like pretty cool stuff, so…
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
87
votes
2 answers

Why did Java 9 introduce the JMOD file format?

Java 9 has three ways to package compiled code in files: JAR JMOD JIMAGE JIMAGE is optimized for speed and space and used by the JVM at runtime so it makes sense why JIMAGE was introduced. JIMAGE files are not supposed to be published to maven…
ams
  • 60,316
  • 68
  • 200
  • 288
82
votes
5 answers

Why project Jigsaw / JPMS?

Java's package management system always seemed simple and effective to me. It is heavily used by the JDK itself. We have been using it to mimic the concept of namespaces and modules. What is Project Jigsaw (aka Java Platform Module System) trying to…
John Eipe
  • 10,922
  • 24
  • 72
  • 114
56
votes
4 answers

What is an automatic module?

Automatic modules are mentioned many times on stackoverflow but I couldn't find a complete, succinct and self-sufficient definition of an automatic module. So, what is an automatic module? Does it export all packages? Does it open all packages? Does…
ZhekaKozlov
  • 36,558
  • 20
  • 126
  • 155
52
votes
2 answers

Project Jigsaw vs Maven

From Jigsaw Project: Make it easier for developers to construct and maintain libraries and large applications, for both the Java SE and EE Platforms. I'm trying to learn what project Jigsaw is and till now it seems that the goal of Project…
justAbit
  • 4,226
  • 2
  • 19
  • 34
51
votes
4 answers

findResource("") returning null when module-info.java is present, why is that?

I'm debugging why in the presence of module-info.java in my Spring Boot application, spring-orm throws an exception during start up time. This is the exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
48
votes
3 answers

Loading classes and resources post Java 9

I was reading this article on InfoQ quoting Reinhold: Developers can still use the Java class path in Java 9 for the Java runtime to search for classes and resource files. It's just that with Java 9's modules, developers no longer need the…
kaqqao
  • 12,984
  • 10
  • 64
  • 118
46
votes
1 answer

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…
42
votes
5 answers

New Keywords in Java 9

One of Java 9's largest features will be a module system defined by Project Jigsaw. When reading slides from the Project Jigsaw: Under the Hood at JavaOne 2015, I noticed the following source code: // src/java.sql/module-info.java module java.sql { …
Will Sherwood
  • 1,484
  • 3
  • 14
  • 27
40
votes
3 answers

What does "Required filename-based automodules detected." warning mean?

In my multi-module project, I created module-info.java only for few modules. And during compilation with maven-compiler-plugin:3.7.0 I'm getting next warning: [WARNING] * Required filename-based automodules detected. Please don't publish this…
37
votes
1 answer

JSR-305 annotations replacement for Java 9

So far we have been using the Findbugs JSR-305 annotations (com.google.code.findbugs:jsr305) and everything including tool support (Sonar, Eclipse, Findbugs, …) has been working fine. However it is our understanding that Jigsaw in Java 9 is going to…
1
2 3
33 34