Is Maven ready for JDK9?

Here is the answer from one Maven PMC member (me): No, it is not. Robert Scholte is working on it. Jigsaw and other stuff introduced a lot of changes. There is no official timeframe where full compat (Maven + official plugins) will be given. The issue you see is actually not Maven but Plexus Archiver. … Read more

Can Java 9 run on a 32-bit OS?

Although the 32-bit binaries for JDK9 seem to be missing from Oracle’s lousy, unencrypted download page, if (after clicking “Accept License Agreement”) you copy the URL of the 64-bit binaries and change x64 to x86, it will give you the 32-bit binaries. Update: And now it’s gone. Bizarre! What is Oracle playing at? They went … Read more

JDK9: An illegal reflective access operation has occurred. org.python.core.PySystemState

The ideal way to resolve this would be to reporting this to the maintainers of org.python.core.PySystemState and asking them to fix such reflective access going forward. If the default mode permits illegal reflective access, however, then it’s essential to make that known so that people aren’t surprised when this is no longer the default mode … Read more

Java 9 + maven + junit: does test code need module-info.java of its own and where to put it?

The module system does not distinguish between production code and test code, so if you choose to modularize test code, the prod.module and the test.module cannot share the same package com.acme.project, as described in the specs: Non-interference — The Java compiler, virtual machine, and run-time system must ensure that modules that contain packages of the … Read more

Why does String.replaceAll() work differently in Java 8 from Java 9?

Most likely due to JDK-6609854 and JDK-8189343 which reported negative nested character classes handling (in your example [^[0-9-]]). This behavior was fixed in 9 and 10, but fix was not backported to 8. The bug for Java 8 is explained as: In Java, the negation does not apply to anything appearing in nested [brackets] So … Read more

List.of() or Collections.emptyList()

Collections.emptyList() does not need to create a new object for each call; it’s typical, as in OpenJDK, to just return the singleton EMPTY_LIST object. Additionally, it’s clearer that you intend to mean an empty list rather than having forgotten to fill in a placeholder. Use emptyList(); it’s both faster (up to Java target level 1.9) … Read more

Difference between compact strings and compressed strings in Java 9

Compressed strings (Java 6) and compact strings (Java 9) both have the same motivation (strings are often effectively Latin-1, so half the space is wasted) and goal (make those strings small) but the implementations differ a lot. Compressed Strings In an interview Aleksey Shipilëv (who was in charge of implementing the Java 9 feature) had … Read more

How to import external libraries in jshell java 9?

I tried with 9 Build 162 Linux 64-bit with preparation: Downloaded guava-19.0.jar and commons-lang3-3.4.jar to /opt/libs The following options are available: Specify CLASSPATH environment variable: $> CLASSPATH=”/opt/libs/commons-lang3-3.4.jar:/opt/libs/guava-19.0.jar” bin/jshell Specify classpath with jshell option: $> bin/jshell –class-path /opt/libs/guava-19.0.jar:/opt/libs/commons-lang3-3.4.jar Configure evaluation context within jshell session with command /env, /reset or /reload(these commands are different, you can check … Read more

Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1

In JDK 9+, add the following option to the JVM to disable the warning from Spring’s use of CGLIB: –add-opens java.base/java.lang=ALL-UNNAMED for example: java –add-opens java.base/java.lang=ALL-UNNAMED -jar target/*.jar No need to report it; it’s a known Spring bug. This happens because the new JDK 9 module system detected an illegal access that will be disallowed … Read more

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