Package conflicts with automatic modules in Java 9

Am I using the new module system correctly? Yes. What you are seeing is intended behavior, and this is because JPMS modules do not allow split packages. In case you are not familiar with the term “split packages” it essentially means two members of the same package coming from two different modules. For example: com.foo.A … Read more

Create Java runtime image on one platform for another using Jlink

The include directory is for header files, such as jni.h, that are needed when compiling C/C++ code that uses JNI and other native interfaces. It’s nothing to do with jlink. The jlink tool can create a run-time image for another platform (cross targeting). You need to download two JDKs to do this. One for the … Read more

Properly implementing Java modules in a Maven build with inter-module test dependencies

Based on your demo project, I was able to duplicate your error. That said, here are the revised changes I made, after my first failed attempt, to be able to build the project: I added the maven-compiler-plugin version 3.8.0 to all the modules. You need a version of 3.7 or higher to compile modules with … Read more

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

You can use class path and module path in parallel, but there are a few details to consider. Dependency Module Path ~> Class Path Explicit modules (JARs with a module descriptor on the module path) can not read the unnamed module (JARs on the class path) – that was done on purpose to prevent modular … Read more

Loading classes and resources post Java 9

First, to set the record straight, I neither said nor wrote the text quoted above. I’d never have put it that way. That’s just sloppy reporting on the part of the publications involved. The most important thing to understand about class loading and resource lookup in Java 9 is that, at a fundamental level, they … Read more

JSR-305 annotations replacement for Java 9

It’s true that two modules cannot, ordinarily, define types in the same package. Until recently, putting jsr305.jar on the class path of a JDK 9 build would have no effect: That JAR file defines types in the javax.annotation package but that package is defined in the platform’s built-in java.xml.ws.annotation module, and the latter takes precedence. Owing … Read more

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

Automatic module recap An explicit module (i.e. one with a module-info.java) can only access code of modules that it requires (ignoring implied readability for a moment). That’s great if all dependencies are modularized, but what if they are not? How to refer to a JAR that isn’t modular? Automatic modules are the answer: Any JAR … Read more

New Keywords in Java 9

The keywords added for module declarations in Java 9 are summarized in §3.9 of the Java Language Specification, Java SE 9 Edition: A further ten character sequences are restricted keywords: open, module, requires, transitive, exports, opens, to, uses, provides, and with. These character sequences are tokenized as keywords solely where they appear as terminals in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)