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
0 answers

Groovy Console with Java 9 throws JAXBException

Windows 10 OS, Java 9, Groovy 2.5.7 (newly upgraded) I launch the Groovy Console, and run this println "hello" I get this exception Exception thrown java.lang.NoClassDefFoundError: Unable to load class…
mike rodent
  • 14,126
  • 11
  • 103
  • 157
0
votes
0 answers

Practical use for requires static from java module system

I try to find out what does requires static means and when should I use it. Short answer is: A requires static clause expresses a dependency that is optional at run time. Frankly speaking I don't understand practical use of it. This is the crux of…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
0
votes
0 answers

JDK9+ - The type org.springframework.beans.factory.annotation.Autowire cannot be resolved. It is indirectly referenced from required .class files

I am trying to run a very simple hello world in order to learn WebFlux (https://dzone.com/articles/spring-webflux-getting-started). I can compile the project successfully but I am getting the error mentioned in the topic either in Eclipse and also…
Jim C
  • 3,957
  • 25
  • 85
  • 162
0
votes
0 answers

Project maven-builds fine, but when I create module-info.java, I get "The forked VM terminated without properly saying goodbye."

I have a simple project which uses maven, spring-boot, and connects to a postresql-Database. When I run mvn clean install, everything runs fine, even the tests. (I am compiling it with java 10) Then I add a module-info.java to turn it into a java9…
MJL
  • 352
  • 3
  • 11
0
votes
2 answers

Efficient Java construct for Arraylist Processing and calling different methods

Please, Is there an elegant and efficient way of doing the following in Post Java 8 i.e. 1. Looping through an arraylist 2. Reading the object 3. Calling different methods of potentially different objects using the values contained in the arraylist…
Mega
  • 1,304
  • 5
  • 22
  • 37
0
votes
2 answers

When Eclipse is building my workspace, it freezes

When eclipse is building my workspace, it gets held up at about 19% when updating an unmodified(after project creation) javafx application. Why is it doing this and how can I fix it? OS: Windows 8 Eclipse Version: 4.7 JDK 9.0.1 JRE 1.8 I've seen…
0
votes
1 answer

How Jshell works without semicolon at end of line

I'm new for java 9 and just practicing some snippet of code on jshell jshell> System.out.println("hello"); hello jshell> System.out.println("hello") hello In the both the cases I'm getting output of hello but jshell works without semicolon at…
app
  • 733
  • 5
  • 15
  • 27
0
votes
0 answers

Java 9 Module / Service System - get an instanced service provider by name, or a new one if none exists?

I am trying to learn about the Java 9 Services, so this is might not be an ideal scenario but what I am using to try to learn services, specifically... I am trying to create a service for DatabaseConnection classes. There might be a provider for…
Wige
  • 3,788
  • 8
  • 37
  • 58
0
votes
1 answer

Inter-Thread communication not working properly in Java9 and later version

Something changed from Java8 to Java9 behind the scenes in Thread Scheduler. I'm trying to narrow down the change in below program. Below program spawns 3 threads which run parallely and synchronously passing the monitor lock properly,…
skY
  • 111
  • 7
0
votes
1 answer

How to patch a package-info.java file when using modules?

I am able to patch system module files using these instructions. https://openjdk.java.net/projects/jigsaw/quick-start#xoverride When trying the same command to patch a package-info.java, the package-info.class file is not generated if the patched…
Antonio
  • 88
  • 6
0
votes
1 answer

Store array data in a file on Java 9 text output/input

I just started learning how to write into file and read from a file on java oi. Now I can write simple text into a file and also can read it using system.out.print. The problem now is, I tried to create an array and store it in a file using the same…
0
votes
1 answer

Failed to run tests in gradle project with error : 'Could not create the Java Virtual Machine'

I am trying to execute a test inside a gradle project.But when Itry to execute the tests using 'gradle test' in Intellij it fails . what I have tried create and build the project without error using 'gradle clean build' open run configuration in…
letsStudyJava
  • 159
  • 2
  • 10
0
votes
0 answers

Does orTimeout method of CompletableFuture on Java-9 kill the long running task?

Let's assume, doWork method runs so long and we set timeOut. In this case, does orTimeout kills the running task and the Thread? CompletableFuture future = doWork("JavaSampleApproach") .orTimeout(TIMEOUT,…
Sarvar Nishonboyev
  • 12,262
  • 10
  • 69
  • 70
0
votes
0 answers

using custom JRE in android Studio

I just read some new features of Java 9. There is a concept Jlink through which we can create a custom JRE and can use the path of that custom JRE in java command while running a class. So I am curious to know that how can I use that custom JRE in…
nitin tyagi
  • 1,176
  • 1
  • 19
  • 52
0
votes
0 answers

Access restriction in java after Java9

With the introduction of modules in Java 9, do the access restrictions based on access modifiers for classes have any real relevance. Module definition can ultimately control what is exposed outside and that is what is really important for a utility…
pawinder gupta
  • 1,225
  • 16
  • 35