Is try-with-resource not safe when declaring multiple effectively final resources?

Since Java 9 we can use effectively final variables in try-with-resources. The example below presents a situation where one of the resources initialization throws an exception. public static void …

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 …

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. /home/vadim/IdeaProjects/test_modules/src/main/java/module-info.java:2: error: module not found: …

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 …

JAXB not available on Tomcat 9 and Java 9/10

TLDR: On Java 9/10, a web app in Tomcat has no access to JAXB even though its reference implementation is present on the class path. Edit: No, this is not a duplicate of How to resolve java.lang….

java 9 unnamed module reads package [X] from both … while debugging (with IntelliJ)

In my project I have a package that uses several 3rd party libraries. Let’s have a look at the dependency tree: [INFO] +- commons-logging:commons-logging:jar:1.2:compile [INFO] +- org.apache….

Replacements for deprecated JPMS modules with Java EE APIs

Java 9 deprecated six modules that contain Java EE APIs and they are going to be removed soon: java.activation with javax.activation package java.corba with javax.activity, javax.rmi, javax.rmi.CORBA,…

Classloaders hierarchy in Java 9

As of Java 8, I know the hierarchy of the classloaders has been as follows: Bootstrap classloader → Extension classloader → Application classloader What is the change in the hierarchy of …

Is it possible to mix –class-path and –module-path in javac (JDK 9)?

When I compile a module that depends on other modules I’ve compiled previously I have to specify the –module-path option. This makes modules I depend on visible. But at the same …

Where to place module-info.java using Java 9?

I have an OSGI application and I have around 30 bundles (jar files). Today I decided to see how it works/if it works with Java 9. So I started my application and got WARNING: An illegal reflective …