Difference between RxJava API and the Java 9 Flow API

What are the main differences between these two libraries? The Java 9 Flow API is not a standalone library but a component of the Java Standard Edition library and consists of 4 interfaces adopted from the Reactive Streams specification established in early 2015. In theory, it’s inclusion can enable in-JDK specific usages, such as the … Read more

What is the replacement for javax.activation package in java 9?

JavaBeans Activation Framework (JAF) is possibly the alternative you are looking for to the existing package. This standalone release of JAF uses a Java Platform Module System automatic module name of java.activation, to match the module name used in JDK 9. A future version will include full module metadata. The standalone APIs are supported in … Read more

Why project Jigsaw / JPMS?

Jigsaw and OSGi are trying to solve the same problem: how to allow coarser-grained modules to interact while shielding their internals. In Jigsaw’s case, the coarser-grained modules include Java classes, packages, and their dependencies. Here’s an example: Spring and Hibernate. Both have a dependency on a 3rd party JAR CGLIB, but they use different, incompatible … Read more

Why did Java 9 introduce the JMOD file format?

The purpose of JMODs are not well documented and existing documentation is rather sparse. Here is an in-depth explanation of system, from my understanding. Parts of this answer are rather long, verbose, partially redundant, and a tough read. Constructive, structural, or grammatical edits are more than welcome to improve readability for future readers. Short(er) Answer … Read more

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

With –add-exports the package is exported, meaning all public types and members therein are accessible at compile and run time. With –add-opens the package is opened, meaning all types and members (not only public ones!) therein are accessible at run time. So the main difference at run time is that –add-opens allows “deep reflection”, meaning … Read more

How to hide warning “Illegal reflective access” in java 9 without JVM argument?

There are ways to disable illegal access warning, though I do not recommend doing this. 1. Simple approach Since the warning is printed to the default error stream, you can simply close this stream and redirect stderr to stdout. public static void disableWarning() { System.err.close(); System.setErr(System.out); } Notes: This approach merges error and output streams. … Read more

What’s the difference between requires and requires transitive statements in Java 9?

Readability recap If module bar requires module drink, then the module system… enforces the presence of drink (called reliable configuration) allows bar to read drink (called readability) allows code in bar to access public classes in exported packages in drink (called accessibility) Exactly the same happens if bar requires transitive drink – drink must be … Read more

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