Im a beginner in Java so sorry in advance if I dont understand certain words.
I keep having the error: Cannot resolve symbol @EnableEurekaServer... When I manually type in the import line for eureka server, the word "cloud" is highlighted red in:
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
In my build.gradle file, I have
compile('org.springframework.cloud:spring-cloud-netflix-eureka-server')
Why does this happen... Everything looks like it's supposed to work. I can provide screenshots of things if asked!
My build.gradle file looks like this:
buildscript {
ext {
springBootVersion = '2.0.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.cloud:spring-cloud-netflix-eureka-server')
compile('org.springframework.boot:spring-boot-starter-web')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
My EurekaApplicationServer.java looks like this:
package com.example.eurekaserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
public class EurekaApplicationServer {
public static void main(String[] args) {
SpringApplication.run(EurekaApplicationServer.class, args);
}
}