Installation Spring: erreur
Bonjour, j'essaie de travailler avec le framework Spring. Cependant, en voulant executer ce code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@GetMapping("/hello")
public String hello(@RequestParam(value = "name", defaultValue = "World") String name) {
return String.format("Hello %s!", name);
}
} |
avec cette commande dans le terminal:
j'obtiens cette erreur:
Code:
1 2
| Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.5:run (default-cli) on project demo: Application finished with exit co
de: 1 -> [Help 1] |
J'ai essayé de chercher une solution, mais je ne vois vraiment pas d'où cela vient. J'ai bien installé Jdk et Jre dans le bon dossier, mais je suis toujours incapable d'executer le code.
Auriez-vous une suggestion à me proposer ?
Cordialement