Change base line to Java 11. Upgrade dotenv-java to 3.0.0.
Installation
Maven
<dependency>
<groupId>me.paulschwarz</groupId>
<artifactId>spring-dotenv</artifactId>
<version>4.0.0</version>
</dependency>
Gradle
implementation 'me.paulschwarz:spring-dotenv:4.0.0'