Questions tagged [java-11]

Use this tag for questions specific to Java 11, which is version 11 of the Java platform, released on 25 September 2018. In most cases you should also specify the java tag.

JEPs targeted with this JDK release:

  • 181: Nest-Based Access Control
  • 309: Dynamic Class-File Constants
  • 315: Improve Aarch64 Intrinsics
  • 318: Epsilon: A No-Op Garbage Collector
  • 320: Remove the Java EE and CORBA Modules
  • 321: HTTP Client (Standard)
  • 323: Local-Variable Syntax for Lambda Parameters
  • 324: Key Agreement with Curve25519 and Curve448
  • 327: Unicode 10
  • 328: Flight Recorder
  • 329: ChaCha20 and Poly1305 Cryptographic Algorithms
  • 330: Launch Single-File Source-Code Programs
  • 331: Low-Overhead Heap Profiling
  • 332: Transport Layer Security (TLS) 1.3
  • 333: ZGC: A Scalable Low-Latency Garbage Collector    (Experimental)
  • 335: Deprecate the Nashorn JavaScript Engine
  • 336: Deprecate the Pack200 Tools and API

Early access builds are available for this release

Production-ready binaries under the GPL are available from Oracle; binaries from other vendors will follow shortly.

JDK 11 release Notes

JSR 384

2873 questions
83
votes
1 answer

Where is JRE 11?

UPDATE: (to be more clear) You can find JRE 8, JRE 9 and JRE 10 on Oracle's official website (click on each). But where is JRE 11?! Also, JDK 11 doesn't include a JRE. I was expecting JRE to be installed with JDK. Do final users of our apps need to…
Mir-Ismaili
  • 13,974
  • 8
  • 82
  • 100
77
votes
4 answers

Eclipse internal error "Polling news feeds"

I'm using Eclipse(4.9.0) on my MacBook (High Sierra, Java 11) and this error is showing sometimes, if I'm on another app, the errors create a "stack" as you see in the screenshot, it is annoying to come back to Eclipse and to close this error every…
Agustín Clemente
  • 1,178
  • 3
  • 13
  • 23
74
votes
6 answers

Is log4j2 compatible with Java 11?

I tried to run my project on the latest Java 11. Everything works, except the specific file logger. Logging works fine on previous Java versions - 10, 9, 8, but not on Java 11. During server run I see only 1 warning: WARNING:…
Dmitriy Dumanskiy
  • 11,657
  • 9
  • 37
  • 57
72
votes
7 answers

JDK 11.0.2 compilation fails with javac NPE on anonymous parameterized class type inference

Code (spring-web 5.1.2) public static void main(String[] args) { RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = new HttpHeaders(); headers.set(HttpHeaders.AUTHORIZATION, "token"); HttpEntity
Mikhail Kholodkov
  • 23,642
  • 17
  • 61
  • 78
69
votes
3 answers

How to use JDK without JRE in Java 11

We are planning to migrate our Java 8 project to use Java 11. But I noticed that Java 11 doesn't have a JRE folder. In Java 9 and Java 10, folder structures are changed i.e. java\jdk1.x or java\jre1.x, where x is Java 9 or 10. But in Java 11, I am…
Maha Lak
  • 825
  • 1
  • 7
  • 7
68
votes
7 answers

JDK 11+ and Javadoc

Exit code: 1 - javadoc: error - The code being documented uses packages in the unnamed module, but the packages defined in https://docs.oracle.com/en/java/javase/11/docs/api/ are in named modules. Has anyone been able to make javadoc work without…
Rafael Ibasco
  • 1,342
  • 3
  • 14
  • 19
67
votes
6 answers

How to write code in Java 11, but target Java 8 and above?

I am working on a small library and for obvious reasons I would like to write code using all the Java 11 features (except modules I guess for now), but I would like the library to be compatible with Java 8 and above. When I try this: javac -source…
neshkeev
  • 6,280
  • 3
  • 26
  • 47
62
votes
1 answer

Java Casting: Java 11 throws LambdaConversionException while 1.8 does not

the following code works perfectly fine in a Java 1.8 VM but produces a LambdaConversionException when executed in a Java 11 VM. Wheres the difference and why does it behave like this? Code: public void addSomeListener(Component comp){ if(comp…
Gerrit Sedlaczek
  • 1,231
  • 1
  • 14
  • 32
61
votes
1 answer

Paths.get vs Path.of

As far as I can tell, Paths.get and Path.of seem to do exactly the same thing, turning one or more strings into a Path object; the documentations for Paths.get and Path.of use the same wording. Are they in fact identical? Path.of was introduced…
rwallace
  • 31,405
  • 40
  • 123
  • 242
59
votes
4 answers

Is there a replacement library for CORBA in JDK 11

JDK-11 will remove a lot of older parts of the JDK (JEP-320). For some of them (e.g. JAXB) functionality will be provided as regular library. You simply add another dependency and everything works fine again. But not so for CORBA, because There is…
rli
  • 1,745
  • 1
  • 14
  • 25
56
votes
2 answers

Why is Java 14 not LTS?

Java 14 is non-LTS. Given the new release train of 6 monthly releases and that 8 and 11 were LTS, should Java 14 not have been the next LTS release? Or is purely based on the Java architects to decide which they pick for LTS? I did search online but…
Andy Cribbens
  • 1,370
  • 2
  • 11
  • 22
55
votes
2 answers

Why does the Java compiler 11 use invokevirtual to call private methods?

When compiling the code below with the Java compiler from OpenJDK 8, the call to foo() is done via an invokespecial, but when OpenJDK 11 is used, an invokevirtual is emitted. public class Invoke { public void call() { foo(); } private…
Julien
  • 2,139
  • 1
  • 19
  • 32
54
votes
1 answer

Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer

I have a method as of below which has been running properly for a long time: private String loadFromFile(){ RandomAccessFile inFile = null; FileChannel inChannel = null; StringBuilder sb = new StringBuilder(); try { inFile…
garykwwong
  • 2,327
  • 2
  • 16
  • 20
54
votes
0 answers

Java 11 -- performance regressions against Java 8?

UPDATE: Seeing as each method might be suffering from a different performance issue I decided to split this question into two: Empty methods noticeably slower in Java 11 than Java 8 Consuming stack traces noticeably slower in Java 11 than Java…
Gili
  • 86,244
  • 97
  • 390
  • 689
54
votes
10 answers

Maven 3.8.0 Compiler - Fatal error compiling: release version 11 not supported

I'm unable to build using Java 11 with the latest version of the maven-compiler-plugin. pom.xml: org.apache.maven.plugins
mip
  • 1,886
  • 8
  • 26
  • 32