Java 11

Feature Name Description
What are the methods added in String API in Java 11
  • isBlank - Returns true if the String is empty or contains only spaces
  • lines - Returns a stream of lines extracted from the string, separated by line terminators such as \n, \r
  • strip(), stripLeading(), stripTrailing() - strip whitespaces from the string
  • repeat(int n) - Returns a new string which is the concatenation of this string repeated 'n' times
What is the Z Garbage Collector introduced in Java 11? The Z Garbage Collector, also known as ZGC, is a scalable low latency garbage collector designed to meet the following goals:
  • Pause times do not exceed 10ms
  • Pause times do not increase with the heap or live-set size
  • Handle heaps ranging from a few hundred megabytes to multiterabytes in size
Also exists: The experimental Shenandoah garbage collector (Java 12), Java’s Concurrent Mark Sweep (CMS) garbage collector (Removed)
What is the Java Flight Recorder introduced in Java 11? Java Flight Recorder (JFR) is a Java profiling tool that monitors and diagnoses a running Java application. It is responsible for collecting data about the running environment, JVM and Java application and dumps the recorded data into a .jfr file, and we can use Java Mission Control (JMC) to analyze and visualize the .jfr file.
How to launch Single-File Source-Code Programs in JDK 11? Before Java 11
java HelloWorld
How to get Java 11 run-time environment working since there is no more JRE 11 for download?
  • Download and use an OpenJDK Java 11 JDK from the OpenJDK site.
  • Download and use an Oracle Java 11 JDK from the Oracle site and be sure that you fully understand the restrictions on "commercial use" that now apply to the Oracle Java 11+ releases.
  • Roll own Windows JRE for Windows from the OpenJDK sources; see Create jre from OpenJDK Windows.
  • Look into using the new jlink tool to create a custom image (basically a cut-down JRE) for your application. This seems to be the option that Oracle want 3rd-party application developers to use.
  • Talk to Oracle sales about a Java support contract, and specifically ask about how to get a JRE build.
  • Use a 3rd-party Java JRE distribution such as AdoptOpenJDK.
New Java HttpClient introduced This HTTP Client API, in the package was introduced in Java 9, updated in Java 10, now a standard feature in Java 11.