-2

Hello I want to develop a web app in spring boot But that makes me an error

I'm using a - vs code I downloaded the library from here https://start.spring.io/

and this is my error

Error: Could not find or load main class com.example.demo.DemoApplication
Caused by: java.lang.ClassNotFoundException: com.example.demo.DemoApplication
PS C:\Users\Itzik\Desktop\לימודים\JAVA\demo>

Each time I try to run

  • Check this https://stackoverflow.com/questions/20740703/java-lang-classnotfoundexception-org-springframework-boot-springapplication-mav – soorapadman Nov 13 '19 at 12:46
  • Please give more details on how you are running the app – pepevalbe Nov 13 '19 at 12:49
  • Sorry but i am new to java i have learned base and i want to start developing web app with spring boot –  Nov 13 '19 at 12:51

5 Answers5

1

You need to define the Java bin path first. Please java path is defined well. Than, if your project is in maven please use

mvn spring-boot:run

on shall/terminal/cmd or your project is gradle, please run the below code

gradle bootRun
Dr. X
  • 2,890
  • 2
  • 15
  • 37
0

You need to right-click on your class that has Main method > Run > Java Application.

zawarudo
  • 1,907
  • 2
  • 10
  • 20
0

The error clearly says that Class not found. You need to compile the code first, try to build the project. Download relevant dependencies and than run it. It will work for sure.

Shubham
  • 997
  • 1
  • 9
  • 15
0
  1. Generate project by using following url https://start.spring.io/
  2. Once project generated extract and import into IDE
  3. If using Eclipse right click of Application.java and run as java
  4. If using STS right click on project and run as spring boot project
Swarit Agarwal
  • 2,520
  • 1
  • 26
  • 33
0

You have some special characters in your path. C:\Users\Itzik\Desktop\לימודים\JAVA\demo>

Please unzip a simple directory: c:\mywork\

Homan Huang
  • 413
  • 5
  • 8