I had Gradle which was running through CLI with Java 8. I had to update to Java 11 Azul, but after that it started to give an error
C:>gradle
Error: Could not find or load main class C:dataworkspacedevoolsjava_security
Caused by: java.lang.ClassNotFoundException: C:dataworkspacedevoolsjava_security
Error: Could not find or load main class C:dataworkspacedevoolsjava_security
Caused by: java.lang.ClassNotFoundException: C:dataworkspacedevoolsjava_security
I have added certificates(cacerts) to <azul-jdk11-location>/lib/security
directory from <oracle-jdk8-location>/jre/lib/security
Here are my versions:
C:>%JAVA_HOME%
'C:JavaJDK11Azul' is not recognized as an internal or external command,
operable program or batch file.
C:>%GRADLE_HOME%
'C:Gradlegradle-5.4in' is not recognized as an internal or external command,
operable program or batch file.
Weirdly my java version is still Java 8 after changing JAVA_HOME
C:>java -version
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
I am able to run Gradle project from IDE giving the Gradle and JDK11 path. I want to run Gradle through CLI. Is there a misconfiguration on my machine?
question from:
https://stackoverflow.com/questions/65839543/gradle-could-not-find-main-class-caused-by-java-lang-classnotfoundexception-c 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…