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 9 Modules VScode

I've been trying to work on Java 9's modules and I've been using VSCode to do so. I found no resource(webpage, YT video) or anything describing how the modules(Not JAR files) can be added to the build path in VSCode. Any link to resources or answers…
Techie Saaketh
  • 11
  • 1
  • 2
  • 5
0
votes
1 answer

Noname module issue with gradle dependency (Java 9)

I'm trying to port existing JavaFX app to Java 9. Here's build.gradle plugins { id 'application' id 'java' id 'org.openjfx.javafxplugin' version '0.0.9' } repositories { mavenLocal() maven { url =…
Barmaley
  • 16,638
  • 18
  • 73
  • 146
0
votes
0 answers

how to use gradle build java library with module system?

how to use gradle build java library with module system ? how to use gradle to do this: build a jar with module-info.java the jar can be use to both java8 and java9
Kingson wu
  • 69
  • 1
  • 3
0
votes
1 answer

How to open test package in module-info? Calling non-test class method in test class

I have Eclipse project in which i use Maven. I also use surefire plugin for tests. I wrote some test classes and tried to run mvn test, however i get this exception: java.lang.reflect.InaccessibleObjectException: Unable to make static void…
Wortig
  • 963
  • 2
  • 11
  • 37
0
votes
1 answer

Read between two lines from a String in Java

I have a stream of text lines and I have to read a range from this string. As an example, a given string: str = "1 ddsfsdfs d 6 s4. 3t sdfdsfsfsf dfdsfsfdfsdfd 345345 dsfsdf45v"; And I have to read between ranges i.e. from line 4 to line 6. How to…
Exploring
  • 2,493
  • 11
  • 56
  • 97
0
votes
1 answer

how to insert a date-time hh: mm into an array list sorted by times only if the time is 10 min before or after the insertion point

I have one question for my first development project in Java9. I need to insert an Object with some info and a Date type, inside an ArrayList only if the time is not present in the ArrayList and if it respects the condition that every time in the…
RootAtKali
  • 185
  • 1
  • 14
0
votes
0 answers

Using lib with split packages Java9 with maven

I want to use the boofcv and the openimaj libs in a modular javafx application which uses the java module system. The problem is that both libs are using split packages and that is not allowed. I have now learned from the web that in java9 there is…
lanthale
  • 23
  • 3
0
votes
1 answer

Instruct Wildfly to run an application as a modular application (Java 9 modules)

I'm using: Wildfly 21 Java 11 I've just went through the pain of modularizing (with Java 9 modules) an Jakarta EE EAR application of mine that runs on Wildfly 21. This application has a war jar, ejb jars, utility jars (all have a module-info.java…
Marcos
  • 1,237
  • 1
  • 15
  • 31
0
votes
0 answers

Build path issue in Java 9 module development

I'm facing a trivial issue. I have changed the Java version to 9 (installed Java 11) on a java project. Getting an error The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files I understand this is build…
JDev
  • 1
  • 1
0
votes
1 answer

jshell classpath in Windows

I have a list of JARS in a directory and I need to add then to JShell classpath. I was trying to avoid typing each individual JAR file name and using wildcard "*" by CLASSPATH environment variable. But in Windows 10, apparently, jshell is not taking…
SRaj
  • 1,168
  • 1
  • 14
  • 36
0
votes
1 answer

Get value as Class for an Annotation using the jdk.compiler module

I'm writing a Java compiler plugin using the jdk.compiler module and Java 15 with preview features enabled. The jdk.compiler module, introduced in Java 9, according to Oracle, contains all the APIs we used to have in java 8's tools.jar except for…
Auties01
  • 29
  • 1
  • 9
0
votes
2 answers

.getResource("/filename") returns null when maven packaging is pom

I have a Maven project with a submodule, developed in IntelliJ, using Java 11. Unless the pom.xml file contains pom, there is a warning that 'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as…
Helge
  • 145
  • 9
0
votes
1 answer

How to configure surefire plugin, so it could run non-public test classes?

Assume these tools are used for running tests in a maven project: org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5 with default configuration org.junit.jupiter:junit-jupiter-engine:5.7.0 Please, find minimal example here. The project…
diziaq
  • 6,881
  • 16
  • 54
  • 96
0
votes
1 answer

Can't compile a module in java 9 using cmd

Ok, so I'm trying to learn java 9 trough a book I bought, but when I try to compile a module trough the cmd, I get this error message. image of the cmd compile error I have been trying to understand what is happening for the last 2 days.
Arnaut
  • 1
0
votes
0 answers

Why Java 9 collection factory have separate methods for each argument when it have varargs supported

In Java 9 List ,Set and Map interface we have of method which support varargs (static List of(E... elements)), so what's the purpose of having separate methods having arguments one to ten. static List of(E e1) //Returns an…
Joby Wilson Mathews
  • 10,528
  • 6
  • 54
  • 53