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

vertx-hk2 and vertx-jersey split package issue on intellij

I've been trying to migrate a service to java 9 and despite the fact that I can compile and run the fat.jar, I can't run it on Intellij and reason is the split package issues with the libraries vertx-hk2 and vertx.jersey since both libraries have…
Eric Nascimento
  • 381
  • 3
  • 15
0
votes
1 answer

Java 9: Creating Spring Boot App with different modules

I am having a Spring Boot App with Java 9. Depending on the input parameter to maven, I want to create the Spring Boot App Jar with different modules. Example: I have four modules mod1, mod2, mod3, and mod4. If I pass the parameter 'light' then the…
JDev
  • 1,662
  • 4
  • 25
  • 55
0
votes
1 answer

Executing unit tests (and applications) under Java-9 with Maven 3.5

I've found a lot of information about how to coax Maven to compile Java-9 source code, but I haven't run into compiler issues. Instead, I have trouble running under Java-9. Running mvn clean install will compile my code fine, but the build still…
MiguelMunoz
  • 4,548
  • 3
  • 34
  • 51
0
votes
0 answers

Java 9 dynamically load a jar at runtime expanding Class-Path

To all Java 9 users who could help, In versions prior to Java 9, we could dynamically load a jar, by simply appending it to the classpath at runtime. For doing this, we used the Someclass.class.getClassLoader(), casted to an URLClassLoader, thus…
GlobCoder
  • 21
  • 5
0
votes
0 answers

Java 9 Modularity exports is not working

I'm trying to learn java 9 modularity. In my project I have 3 modules - 1. com.red30tech.database 2. com.red30tech.cache 3. com.red30tech.backend. 1 is depend on 2, 3 and 2 is depend on 3. The source code of the project is here. when I try to…
user51
  • 8,843
  • 21
  • 79
  • 158
0
votes
0 answers

Javafx TextField always throws "Empty String" error

The code below is supposed to allow the user to type in the details of the new product they're adding into a list (except the Choicebox). Almost all of the code works, with the exception being the method handlePrice(). Whenever the user attempts to…
nimbus_b
  • 3
  • 1
0
votes
1 answer

JDK 9+ BuiltinClassLoader ModuleReference Resolution Will Use Class Path (not Jar) to Find Resources

I have run into a snag with the JPMS jdk.internal.loader.BuiltinClassLoader when executing main methods in the context of my IDE (I use IntelliJ 2018.1). If a resource is loaded in an in module class using a standard method like …
0
votes
1 answer

Apache Ant version for java 10

Is Ant 1.10.2 compatible with Java 10? The ant documentation is not very clear: it just says that it is compatible with a minimum version of Java 1.5. How can I be sure that it is compatible with java 10? Thank you!
DAIRAV
  • 723
  • 1
  • 9
  • 31
0
votes
0 answers

Unable to run old code with java 9 (10)

I have an executable jar, it was compiled with java 6 and in this project datanucleus is used as ORM (an old version, 1.1.6). The jar runs fine with java 6, 7, 8 but not with 9 (10): running it I get a lot or errors like this one on various…
res1
  • 3,482
  • 5
  • 29
  • 50
0
votes
1 answer

Did I find a compiler bug in java 9?

I'm getting a compile error in Eclipse on line 11. Type mismatch: cannot convert from List to List I believe this code should compile and I've created a short example that demonstrates the problem: import…
satnam
  • 10,719
  • 5
  • 32
  • 42
0
votes
0 answers

Spring Security message source error with Java 9 modules

I am trying to write modularized Java web application using Java 9 modules and Spring framework. I am using Spring Boot 2.0 for this task. Everything seems to be working really well until adding Spring Security to the project. When I add Spring…
Grzegorz B.
  • 346
  • 5
  • 10
0
votes
1 answer

import a jdk7 library in jdk9 module

I have a library compiled with jdk7. Now, I want to import it in a jdk9 module. We are using maven to manage the dependencies, but after adding the library into the dependency. We still can’t find the classes in the library. But if we remove the…
Meilun Sheng
  • 129
  • 1
  • 1
  • 7
0
votes
0 answers

Java 9 Causing NoClassDefFoundError within BootClassPath

I am trying to understand why we are getting the following exception: java.lang.NoClassDefFoundError: java/sql/Connection Let me start by offering some context as to what is happening. I have a set of classes that are contained within a jar…
Claudio Corsi
  • 329
  • 1
  • 4
0
votes
0 answers

Intellij idea cannot resolve jdk 9

I am trying to set JDK 9 as project sdk but it cannot resolve java main classes. When I set JDK 8 as project sdk, it works without any problem. Do I need to do something extra to set JDK 9? Here is libraries; Intellij Version: 2016.2 JDK Version:…
hellzone
  • 5,393
  • 25
  • 82
  • 148
0
votes
0 answers

Spring Assert NoClassDefFoundError when running Spring Boot application

I am using Java 9, Maven and Spring boot 2.0.1 on Eclipse Oxygen. When I run the application, I get this error: Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/util/Assert at…
user5150135
1 2 3
99
100