Spring CLI cannot find main class after installing

533 Views Asked by At

I have JDK 1.8, gradle 6.1, and apache-maven 3.6.3.

I installed the Spring CLI and have set the path variable correctly However when I try to run even a simple command like:

spring --version

I get the following error:

Could not find or load main class org.springframework.boot.loader.JarLauncher

I haven't made a project or antying I am just making sure it works after installing. I'm assuming I am missing some file or program but I have no idea where to start.

UPDATE--

As per the comments I tried running spring version and now I get the error:

Users/jgossling/Desktop/Spring Boot/spring-1.2.0.M2/bin/spring: line 83 : [Users/jgossling/Desktop/Spring: binary operator expected Error: could not find or load main class org.springframeowrk.boot.loader.JarLauncher

1

There are 1 best solutions below

0
Justin Shi On

You can try like that SET PATH=%PATH%;D:\Downloads\spring-2.5.0\bin in cmd. Then, try to code spring --version. But it just works for this command line rather than forever. I make it but I don't really know why it works. Really hope this can help!