Questions tagged [java-9]

Use this tag for questions specific to Java 9, which is version 9 of the Java platform, released on the 21st of September 2017. In most cases you should also specify the java tag.

Oracle has released its updated list of proposed or targeted Java 9 enhancements. In addition to previously confirmed Java modularity updates, the most recent list includes a common logging system for all JVM components (JEP 158), more HotSpot JIT compiler controls (JEP 158), and refinements to improve the efficiency of garbage collection (JEP 214), and repair issues introduced by Project Coin language updates in JDK 7 (JEP 213). This is also the first release under the new version-string schema (JEP 223) and will hence be officially be numbered 9, not "1.9.0" as was the case for earlier versions.

Even with delays, Oracle has been steadily moving forward with its plans to modularize the JDK. But the scope of Java modularity took a step up in September, when Oracle announced four new JEPs, including JEP 220: Modular Run-Time Images. Ben Evans, writing for InfoQ, noted that swapping JARs for modules is the "point of no return for modularity," with serious implications for IDEs, toolmakers, and many Java application frameworks:

After this point, The Java Runtime Environment (JRE) will no longer be contained in jar files, and instead will be composed of modules (JSR 376). Files such as rt.jar and tools.jar no longer exist in the JRE. The platform will continue to accept and run applications and libraries packaged in conventional jar files, modular jar files, or in the new module file format. The intention is that over time, application developers wil migrate to the new modular formats as well.

See "Oracle Commit to Java Modularity" for more from Ben Evans on modularity updates in Java 9. Also see Takipi Blog: "Java 9 – The Ultimate Feature List" for a comprehensive (as of November 20, 2014) description of new features accepted or proposed for the next major release of Java, and "What's New in Java 9? (Besides Modules)" for another more recent compilation of features.

The API documentation of the release can be accessed at Oracle's technetwork.

1606 questions
0
votes
1 answer

Make java.sql package or module available to boot classloader

I am using sql statement wrappers. When trying with jdk 11, I am getting java.lang.NoClassDefFoundError: java/sql/PreparedStatement. From java 9, java.sql is loaded in the platform loader. My wrapper classes are in boot classpath. How do I make any…
0
votes
1 answer

How do I avoid reaching the .or() in this code?

static final Function> toDateOfInjury = b -> toClaim.andThen(opt -> opt.map(Claim::getDatInjuryDate)).apply(b); public static final Supplier> emptyStrOpt = Optional::empty; static final…
FaraBara
  • 115
  • 7
0
votes
0 answers

How secure is module-info.java?

I'm just thinking how secure is the module-info.java , for example lets say if the library provider has added some restriction and opens only few service classes for the consumers. I believe the consumer can easily remove this enforced restriction…
Abdul Mohsin
  • 105
  • 7
0
votes
1 answer

How to make Eclipse autocomplete JShell methods?

I am trying to write a snippet of code using JShell programmatically in Eclipse, but Eclipse filters all members of jdk.jshell.JShell class in autocomplete. I see only members inherited from Object class. I suppose this is because that class is…
Michał Grzejszczak
  • 2,599
  • 1
  • 23
  • 28
0
votes
0 answers

gfe.jar SDLParser from java 1.6 to java 11

Hy, I've ported an old 1.6 java desktop application to java 11, a lot of problems concerning jaxb no more supported on jre but at the end the application is running. Actually I've a problem with a jar named gfe.jar especially on class …
Etantonio
  • 359
  • 1
  • 5
  • 13
0
votes
1 answer

Running Java module from command line breaks when I reverse argument order

I can run a Java module from the command line without issues as follows: java -p "dir/with/module1;dir/with/module2" -m my.module.name //runs fine However, when I reverse the arguments, putting -m (--module) before -p (--module-path), it doesn't…
JellyRaptor
  • 725
  • 1
  • 8
  • 20
0
votes
0 answers

How to use NASA's panoply on Windows system?

I want to use Panoply on my computer (Windows 10). The packages I downloaded from this website said that it requires JAVA 9 (or later version) to install Panoply. But my JAVA version (JAVA 8) on my computer can not be renewed. enter image…
Jaden Tseng
  • 101
  • 1
  • 6
0
votes
0 answers

Modularity issues with javaagent in Java 9

We have a javaagent written in Java 8 that instruments application code using javassist. There is one simple ClassFileTransformer that instruments java.lang.Error class constructor to record an instantiated error. I am retransforming Error class…
Srinivas
  • 31
  • 4
0
votes
0 answers

CompletedStage.completedFuture VS CompletedStage.completedStage

I saw since Java9 CompletedStage.completedStage() is almost equals to CompletedStage.ompletedFuture() When we must return CompletionStage we can return both. CompletedFuture.completedFuture() is not deprecated and in Java doc for…
cyril
  • 872
  • 6
  • 29
0
votes
1 answer

Converting Flux returned from DB to Mono>
My DB is returning Flux I need to convert it to Mono of DTO and return it to caller method. My Fruit class already has a builder method to convert Fruit to FruitDto. If the return type of the caller method had only Mono, I could have easily…
Puneet
  • 13
  • 1
  • 6
0
votes
1 answer

Stream groupBy to nested maps with casting

Need to calculate total number by gender from below structure of nested Maps. But as data stored as Object need to cast it at every iteration. After grouping not able to cast last leaf Map to calculate and filter date object. Map
Sheel
  • 1,010
  • 1
  • 17
  • 30
0
votes
0 answers

Using java.lang.ref.Cleaner in Android project

I am working on an Android project. My setup: Host development machine: Macbook Android studio Arctic Fox, 2020.3.1 Android Gradle Plugin Version 7.0.0 Gradle Version 7.0.2 JDK 11 located under Android Studio.app/Contents/jre/Contents/Home When I…
DwayneDuane
  • 101
  • 3
0
votes
0 answers

IBM i command prompting in JTOpen not working with Java 9 and above

Having compiled my JTOpen application with java 16, I bumped into the following error in the JTOpen command prompter: Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: class com.ibm.as400.ui.framework.java.LookAndFeelManager (in…
Lenny
  • 1
  • 1
0
votes
0 answers

Cannot build executable jar using maven-jar-plugin when migrating to java 9 modules

I am introducing java 9 modules to a big project and I am facing an issue when trying to build an executable JAR (on one of the sub module) using the maven-jar-plugin. Here is a small view of my project: ├───my-sub-module │ ├───pom.xml │ …
Mr. D
  • 657
  • 1
  • 8
  • 21
0
votes
1 answer

How to make Eclipse RUN patched JRE modules on JDK9+ with the —patch-module java option

This SO question asks how to get Eclipse to compile with the —patch-module javac option. However, I have found no obvious and easy way to get Eclipse to run the compiled patched code using the same configuration. i.e. to use the Build Path / Module…
FlyingSheep
  • 804
  • 1
  • 9
  • 20