@barfuin answer is working for me, I had to use equivalent maven config:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<dependenciesToScan>
<dependency>org.junit.jupiter</dependency>
</dependenciesToScan>
<argLine>-Xshare:off</argLine>
</configuration>
</plugin>
</plugins>