I want to upgrade a Java 8 Spring Boot project to Java 11. It uses Gradle 4.9(wrapper). I am using Intellij 2019.1 Community version.
After downloading Java 11, when I run gradle test
, I see this error:
-Djava.endorsed.dirs ..... is not supported. Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modules.
So, how can I solve this?
Oracle intends to support the Java LTS releases as follows: Java 7 through 2022. Java 8 through at least 2030. Java 11 through 2026.
In Windows and macOS, installing the JDK in previous releases optionally installed a JRE. In JDK 11, this is no longer an option. In this release, the JRE or Server JRE is no longer offered. Only the JDK is offered.
I did these things to make it work:
-Djava.endorsed.dirs
. Because with Gradle 5.4, I can already run the tests in terminal by gradle test
. It is only the Intellij run failing.Upgrade Gradle to 6 may not be related; with 5.4.0
it can still work.
In order for this to work in Gitlab pipeline, you have to change
.gitlab-ci.yml
: image: openjdk:11.0.1-jdk-slim
Dockerfile
: FROM gradle:jdk11-slim as builder
to change docker image version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With