Gradle will not launch from the command line. How can I fix this?

Solution for Gradle will not launch from the command line. How can I fix this?
is Given Below:

I’m sorry if this is a repeat question, but I’ve scoured the internet and I couldn’t find any help: gradle will not output anything no matter how I start it; what can I do?

This started with me trying to use Gradle in IntelliJ. The error read as follows:

Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/6.8/userguide/gradle_daemon.html
Process command line: C:Program FilesAdoptOpenJDKjdk-15.0.1.9-openj9binjava.exe -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED -Xms256m -Xmx512m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:Users[my name].gradlewrapperdistsgradle-6.8-bin1jblhjyydfkclfzx1agp92nylgradle-6.8libgradle-launcher-6.8.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.8
Please read the following process output to find out more:
-----------------------

However, there was no process output that followed (it was just the end of the print after the dashes). I thought something was wrong with the Gradle bundled with IntelliJ, so I tried installing the latest Gradle build from gradle.org. After adding the /bin/ folder to my PATH, I tried calling gradle -v from both a command prompt and powershell. Windows didn’t complain that it couldn’t find any command called gradle, so I know I added everything to the path correctly.

I type gradle -v and press ENTER

C:UsersNikhil>gradle -v

The caret moves to the next line and blinks a few times

C:UsersNikhil>gradle -v
_

I am presented with no output and the command ends

C:UsersNikhil>gradle -v
C:UsersNikhil>

I tried running gradle with verbose debug, running gradle with no launch arguments, reinstalling gradle, and even calling the application from the directory instead of from the PATH. I also tried to explore the gradle.bat file provided in the /bin/ folder to see if there is something suppressing the output, but I can’t understand it (I can’t really read any thing more than the most basic of batch files).

One thing to note is that this is all on my laptop. On my desktop computer, gradle works fine–whether it’s from the console or from IntelliJ.

Please let me know what I can do to fix this other than just factory resetting my laptop. If you need any more information, please ask and I can provide.

Key info:

  • Gradle version: 7.1.1
  • Output for echo %JAVA_HOME%: C:Program FilesAdoptOpenJDKjdk-15.0.1.9-openj9
  • Output for java -version:
OpenJDK Runtime Environment (build 1.8.0_292-b10)
Eclipse OpenJ9 VM (build openj9-0.26.0, JRE 1.8.0 Windows 10 amd64-64-Bit Compressed References 20210421_1045 (JIT enabled, AOT enabled)
OpenJ9   - b4cc246d9
OMR      - 162e6f729
JCL      - 2a5e268814 based on jdk8u292-b10)