WesternGun
WesternGun

Reputation: 12767

Upgrade to Java 11: -Djava.endorsed.dirs not supported

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?

Upvotes: 6

Views: 6277

Answers (1)

WesternGun
WesternGun

Reputation: 12767

I did these things to make it work:

  • Upgrade Intellij IDEA to 2019.2.4 Community. It seems that it is using the Java option -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.

Upvotes: 6

Related Questions