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
9
votes
2 answers

java.lang.IllegalStateException: Could not find sun.misc.Unsafe while @MockK

I'm having an issue when creating a mock using MockK. I have tried with kotlin 1.2.* version with MockK without Kotlin 1.3 but it also didn't help. How can I resolve this? Is this because of OpenJDK 11 of it's something else? Java version: openjdk…
lukaszrys
  • 1,656
  • 4
  • 19
  • 33
9
votes
1 answer

Migration to JDK 11 has error occure "java.lang.NoClassDefFoundError: javax/activation/DataSource" (tomcat 9.0.12)

I'm migrating java project use JDK8 to use JDK 11 then has error occurred relate of javax activation. Following migration guide from Oracle, I see java.activation that module was removed from JDK 11. After that, I give a suggest to added third…
SuperBeam
  • 91
  • 1
  • 1
  • 2
9
votes
2 answers

OpenJDK release notes: does not include jar specification?

The JDK 11 release notes say: Oracle JDK includes additional Java SE specifications (such as serialization, jar, rmi) and OpenJDK does not. Anyone knows in what way OpenJDK does not include the jar specification? For sure it can work with jar…
Catweazle
  • 619
  • 12
  • 25
9
votes
3 answers

How to make an internal Java package accessible in Eclipse?

I have a legacy Java (8) project opened in Eclipse with Java 11 (or Java 10). Eclipse is now rightly complaining about inaccessible packages. E.g. com.apple.laf.AquaComboBoxUI. When compiling from command line I can make those packages accessible…
Michael
  • 532
  • 1
  • 6
  • 15
9
votes
1 answer

The jdk.incubator.httpclient module not found in Java11

Using the early access build for JDK/11 to compile an existing code based on Java-9 which was using a VM argument --add-modules jdk.incubator.httpclient to resolve the HTTP/2 client incubator module now ends up with a compilation error Module…
Naman
  • 27,789
  • 26
  • 218
  • 353
8
votes
1 answer

Changes in Instant.now() between java 11 and java 17 in AWS Ubuntu standard 6.0

We are moving to Java 17 (correto17) from Java 11 (correto11). As part of this, we also have to upgrade Ubuntu to standard:6.0 from standard:4.0 in AWS as mentioned here. We are observing that in Java 11 and Java 17 Instant.now() output is a bit…
tuk
  • 5,941
  • 14
  • 79
  • 162
8
votes
8 answers

How to fix jlink does not exist?

i am working with react native and am trying to use expo in a bare project but whenever i try to run the app with the command npm run android, i get this error : Execution failed for task ':expo-modules-core:compileDebugJavaWithJavac'. > Could not…
dukizwe
  • 160
  • 3
  • 9
8
votes
0 answers

PowerMockito 2 on Java 11 error when running test: class javax.xml.parsers.FactoryFinder cannot access class jdk.xml.internal.SecuritySupport

I get an error when running my PowerMockito2 tests on Java 11. I was able to resolve this error by putting this annotation at class level but I do not want to do this. Is there a way not to get this error without using…
javaPlease42
  • 4,699
  • 7
  • 36
  • 65
8
votes
2 answers

Setting a session cookie with the Java 11 HttpClient

I'm trying to GET the content of a page using the Java 11 HttpClient. Since the page uses OAuth, I want to authenticate using my session cookie. I currently use the following code, inspired by this question: public static void main(String[] args)…
Simon Baars
  • 1,877
  • 21
  • 38
8
votes
2 answers

How to timeout on a slow streaming response body with Java's HttpClient

How should I deal with servers that hang sending an HTTP response body using the HTTP client included in Java 11 onwards, when I need to handle the response in a streaming fashion? Having read the documentation, I'm aware that it's possible to set a…
Mark Slater
  • 831
  • 7
  • 18
8
votes
1 answer

Java 11 upgrade from 8 parallel streams throws ClassNotFoundException

I upgraded my spring boot application from Java 8 and tomcat 8 to java 11 and tomcat 9. Everything seems to work fine except the part that I use parallel streams on lists. list.addAll(items .parallelStream() …
PavlMits
  • 523
  • 2
  • 14
8
votes
2 answers

Java superinterfaces runtime difference Java 8 vs Java 9

I noticed a difference in the output of the following program when run with Java 8 and Java 9. import java.lang.reflect.Method; public class OrderingTest { public static void main(String[] args) { ServiceImpl service = new…
Hugh Pearse
  • 699
  • 1
  • 7
  • 18
8
votes
1 answer

JDEPS Module Not Found Exception when listing dependancies

I have been working with JLink to create minimal JRE for various Spring Boot applications. I have successfully done this manually by figuring out the required Modules via trial and error. After successfully doing this I have been attempting to…
8
votes
3 answers

How make cxf-codegen-plugin generate Webservices from jakarta.xml.ws?

Migrating from Java 8 to Java 11. Updated cxf-codegen-plugin from version 3.2.0 to 3.3.6. Plugin still generates Java stubs from wsdl files using packages from javax.jws.* instead of from jakarta.jws.*: import javax.jws.WebMethod; import…
S. Kom
  • 103
  • 1
  • 8
8
votes
2 answers

Unable to throw a `checked` exception when using Java Optional ifPresentOrElse method

Why a checked Exception can't be thrown in the orElse part when using ifPresentOrElse java Optional method ? For example: dao.findBook(id).ifPresentOrElse(book -> { printingService.print(book, printerName); changeBookPrintDate(book.getId(),…
hd84335
  • 8,815
  • 5
  • 34
  • 45