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

java.base missing while trying jlink

I am getting this Error: Module java.base not found while trying to use jlink. These are the 2 things I have tried so far /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/jlink --module-path "%JAVA_HOME%\jmods":mods --add-modules…
coloradoman
  • 341
  • 1
  • 5
  • 11
0
votes
2 answers

How to fix Java 9 Optional "Cannot return a void result" error message?

I had a class with a method like this: public class Client { private project.enums.ClientType clientType; private ClientType clientTypeV2; @JsonIgnore public Optional getCodeClientTypeV2() { return…
Liam Park
  • 414
  • 1
  • 9
  • 26
0
votes
0 answers

Java9 Module - Maven: ServiceLoader.load( HelloInterface.class) cannot find Interface class

In IntelliJ/Maven I want to work with Java9 / modules and the ServiceLoader. I built a simple 2 module project. Using maven the ServiceLoader.load( ...) cannot find the implementation of the HelloInterface.class. Why? I created the project via…
tm1701
  • 7,307
  • 17
  • 79
  • 168
0
votes
1 answer

Inspecting weird ClassNotFoundException allthou it exists

I have a maven project (a) This is the Project-tree: grim@hv0053:~/workspace/a$ tree . ├── pom.xml └── src └── test └── java └── a └── MyTest.java 4 directories, 2 files grim@hv0053:~/workspace/a$ This is…
Grim
  • 1,938
  • 10
  • 56
  • 123
0
votes
0 answers

When parsing the typeAliases tag with package as a subtag in the mybatis framework, a parsing error occurs. I used jdk9 as a development environment

Environment Configure jdk9 mybatis v3.5.4 MacOS Description When I was studying Mybatis, I encountered confusing questions. The configuration in question is as follows:
Aka Monk
  • 11
  • 1
0
votes
1 answer

How can I get the list of all possible packages from lib/ directory using jigsaw helper commands?

I'm not currently building a modular app. However I've seen that that jdeps/jdeprscan can scan into jars for packages. Is there a way to just print all packages contained in all jars inside lib/ using any of the above commands?
Marinos An
  • 9,481
  • 6
  • 63
  • 96
0
votes
1 answer

Spring boot fails with Java9 modules

I have a legacy java application which is a monolith web based on servlet. We want to develop new APIs but outside the monolith. But dependencies with the monolith is a problem. Hence we are exploring to use Java9 modules in the legacy app. As a…
Winster
  • 943
  • 10
  • 28
0
votes
0 answers

Automatic module's name does not get recognized

I have the task to migrate a project from JDK8 to JDK9. It is currently not needed to go for a full migration to jigsaw modules. However, in one of the project's packages the java.xml.ws package is being used, which, as you know, is not accessible…
iliev951
  • 33
  • 4
0
votes
3 answers

What is a proper way to reverse the order of nested java Maps

I'm trying to reverse the order of a nested Map. As there is no built-in function in Map to reverse the order and I'm out of time. I tried several available methods of reversing the order posted by devs but nothing worked and also I didn't see any…
waleed
  • 464
  • 4
  • 13
0
votes
0 answers

Spring modules application properties

I need to create java modules for existing Spring application. I have no experience regarding modules, but so far I've gathered I require to migrate existing packages to new module in order for new modules to work. When I run the app I get the…
0
votes
1 answer

Replacement or way of using ShellFolder.getShellFolder() on Java 11

I'm currently using ShellFolder.getShellFolder() to determine if a particular path is on a local drive (directly connected to Windows machine) or a remote drive. package com.jthink.songkong.analyse.analyser; import…
Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
0
votes
1 answer

Migrating to Java 11 from Java 8. At runtime, Will JDK Internal APIs be accessible from the class files in libraries that were compiled in Java 8?

I understand that any access to JDK Internal APIs from my project's code will be flagged by the Java compiler at compilation. But what about 3rd party library JARs compiled in Java 8. My understanding is that since they were compiled on JDK 8 or…
Zain Qazi
  • 83
  • 3
  • 12
0
votes
0 answers

Class annotations and class loader in Java 11

I've some JavaDoc doclet, just rewritten for the new Java Doclet API, which is run by the Maven plugin, which does this: 1) Loads some jars from a directory and adds them to the context class path. This is like: URL[] urls =
zakmck
  • 2,715
  • 1
  • 37
  • 53
0
votes
1 answer

Is it possible to restrict the usage of service provided by a module in JPMS?

Let's suppose we have JPMS modules - A,B, C etc. A defines some service a.spi.SomeService and all there modules have implementation of this service. For example, module B has an implementation of this service b.spi.SomeServiceImpl, so, in…
Pavel_K
  • 10,748
  • 13
  • 73
  • 186
0
votes
1 answer

The package com.faizan.org is accessible from more than one module: ProjectA, ProjectB using JDK 9+ during build in Eclipse 2019-12

I have 2 projects, say ProjectA and ProjectB, both containing package com.faizan.org. ProjectA is added in the modulepath of ProjectB.