java: package org.springframework.stereotype does not exist

Viewed 70

I'm trying to run a project, so I opened the folder from InteliJ, but it seems that all @Annotations are not working and it gives me this error

java: package org.springframework.stereotype does not exist

Note: It's a Gradle project that doesn't have Pom.xml. Not sure if it requires a certain JDK.

build.gradle:

plugins {
    id 'org.springframework.boot' version '2.5.1'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
    id 'war'
}
1 Answers

I found the answer, so it appears that the Gradle settings dependencies were initiated using the key word "compile", When I changed it to "implementation" it the IDE started to re-download all the Gradle files and it eventually worked

Related