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
35
votes
3 answers

SSLHandshakeException with jlink created runtime

I've got a dropwizard app, which runs fine with the standard JRE. I've tried creating a runtime using jlink which is considerably smaller: /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/jlink --no-header-files --no-man-pages…
rich
  • 18,987
  • 11
  • 75
  • 101
35
votes
3 answers

How to log request/response using java.net.http.HttpClient?

The HttpClient introduced experimentally in Java 9 is now stable in Java 11, but not surprisingly, very few projects seem to actually use it. Documentation is almost non-existing. One of the most commons asks while making a HTTP call is logging of…
Abhijit Sarkar
  • 21,927
  • 20
  • 110
  • 219
35
votes
10 answers

Getting Android sdkmanager to run with Java 11

I am facing a problem while running Android sdkmanager with Java 11 (Not studio, only SDK tools). I don't want to install JDK 8 or something similar. Is there a way to fix this for Android sdkmanager with JDK 11? I have gone through this answer and…
Manish
  • 1,735
  • 2
  • 17
  • 30
35
votes
4 answers

Groovy JDK 11 disable the WARNING message

When I run Groovy 2.5.3 on JDK 11 its giving warning message: groovy -e 'print "hi"' WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1…
sfgroups
  • 18,151
  • 28
  • 132
  • 204
35
votes
5 answers

Can't compile with jdk 11 in IntelliJ, cannot find symbol

I set the JDK 11, it compiles until I use the new method of Java 11 isBlank() of a String when I use that method this error appears when compiling, I tried cleaning the JDK installations, cleaning caches from IntelliJ, rebuilding but nothing helps.…
starsuper
  • 451
  • 1
  • 4
  • 4
34
votes
2 answers

Jenkins - add JDK 11 to JDK list

I need to build my application using Java 11. However the dropdown menu stops at Java 9. What do I do? OpenJDK is acceptable too. I'm on the latest version of Jenkins. Edit: as of now I've downloaded the binaries using wget, extracted them on the…
LppEdd
  • 20,274
  • 11
  • 84
  • 139
33
votes
2 answers

Variable extraction to var in Intellij IDEA

When extracting a variable (ctrl+alt+v) in Intellij IDEA with Java 11, I would like for the default to be that it is extracted to a var instead of the verbose type. var home = "127.0.0.1"; instead of String home = "127.0.0.1"; Is there a way to…
Jewels
  • 966
  • 11
  • 28
32
votes
1 answer

How to use WebServices on Java 11? package javax.jws does not exist

I imigrate my aplication to AdoptOpenJDK11, I have found some problems, like "package javax.jws does not exist", I already configure build path with jar "jsr181-api.jar", it's a webApplication, how I fix it ? Have something new about webservices on…
Moises Coelho
  • 349
  • 1
  • 3
  • 6
32
votes
1 answer

Empty methods noticeably slower in Java 11 than Java 8

I was comparing the performance of JDK 8 and 11 using jmh 1.21 when I ran across some surprising numbers: Java version: 1.8.0_192, vendor: Oracle Corporation Benchmark Mode Cnt Score Error Units MyBenchmark.emptyMethod avgt …
Gili
  • 86,244
  • 97
  • 390
  • 689
32
votes
2 answers

LogManager.getLogger() is unable to determine class name on Java 11

I'm using log4j2 (2.11.1) with Java 11 and attempting to get a Logger object using: private static final Logger LOG = LogManager.getLogger(); (Imported from log4j-api in org.apache.logging.log4j) At runtime, I receive the following error: WARNING:…
Daniel Scott
  • 7,418
  • 5
  • 39
  • 58
32
votes
3 answers

Minimum Spring version compatible with Java 11

I need to upgrade an app to Java 11 very soon, I was wondering what's the minimum Spring version that is compatible with Java 11. I'm currently using Java 8 and Spring 4.2.7.
kms333
  • 3,147
  • 7
  • 31
  • 39
31
votes
3 answers

What is the use case for null(Input/Output)Stream API in Java?

With Java 11, I could initialize an InputStream as: InputStream inputStream = InputStream.nullInputStream(); But I am unable to understand a potential use case of InputStream.nullInputStream or a similar API for OutputStream i.e.…
Naman
  • 27,789
  • 26
  • 218
  • 353
30
votes
2 answers

Consuming stack traces noticeably slower in Java 11 than Java 8

I was comparing the performance of JDK 8 and 11 using jmh 1.21 when I ran across some surprising numbers: Java version: 1.8.0_192, vendor: Oracle Corporation Benchmark Mode Cnt Score Error …
Gili
  • 86,244
  • 97
  • 390
  • 689
29
votes
3 answers

Migration JAXWS application from Java 8 to Java 11

I am looking for compatible combination of org.apache.cxf:cxf-spring-boot-starter-jaxws with jaxws-api/jaxws-ri on Java 10+. Our application works fine on Java 8. Also on Java 9 & 10 with --add-modules=java.se.ee. But, when i remove this option and…
amjr
  • 291
  • 1
  • 3
  • 5
27
votes
2 answers

How to install oracle jdk11 in Alpine linux docker image?

My Dockerfile: FROM frolvlad/alpine-glibc:latest ADD jdk-11.0.6_linux-x64_bin.tar.gz /usr/java ENV JAVA_HOME=/usr/java/jdk-11.0.6 ENV PATH=$JAVA_HOME/bin:$PATH When I run the command java -version in the container, I get this segfault: How can I…
DWG24
  • 271
  • 1
  • 3
  • 3