1

I got a Maven project setup with Spark. I followed Spark's documentation on how to create a simple get request: http://sparkjava.com/documentation#getting-started

but I get these errors:

enter image description here

What can be the cause here? (I'm very new to Java and just want to create a simple API) Thanks!

koiralo
  • 22,594
  • 6
  • 51
  • 72
gospecomid12
  • 712
  • 3
  • 11
  • 25
  • 3
    If you have added the dependency to your `pom.xml` this can be an IDE related problem. Have you tried to reload the maven-project? – csalmhof Jul 13 '21 at 07:09
  • 1
    As @csalmhof said: You have a `maven` tab on the right side of the screen, there you should see a a reload icon (looks like this: ). Or another way: https://stackoverflow.com/questions/9980869/force-intellij-idea-to-reread-all-maven-dependencies – Lino Jul 13 '21 at 07:17
  • Did you run a mvn clean install from the command line? – Chris Neve Jul 13 '21 at 07:25
  • Reloading was the solution, thank you guys! – gospecomid12 Jul 13 '21 at 08:10

1 Answers1

1

Just for completeness here as answer:

This is an IDE related problem from IntelliJ, which can be solved by reloading the maven project.

You can do this in several ways:

From the maven tab

enter image description here

From the context menu

The same effect you can achieve from the context-menu of the project (Right-click -> Maven - Reload Project)

Searching the action

Press Ctrl+Shift+A to find actions, and input "reload", you will find the "Reload All Maven Projects".

csalmhof
  • 1,820
  • 2
  • 15
  • 24