Oray Kurt
Oray Kurt

Reputation: 9

java.lang.IllegalArgumentException: Sources must not be empty

What is the problem? It was working as well while I updated Ubuntu's software

Main.class

package okt.springbootstarter.test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class CourseApiApp {

    public static void main(String[] args) {

        SpringApplication.run(CourseApiApp.class, args);

    }
}

pom.xml

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.10.RELEASE</version>
  </parent>

  <dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
  </dependencies>   

I don't know where is the problem?

Upvotes: 1

Views: 8975

Answers (3)

Gangadhar Panda
Gangadhar Panda

Reputation: 41

I was facing the same issue.

Try this out, it looks like you are running a wrong class file. Go to Java file which contains @SpringBootApplication annotation.

e.g (default content):

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
} 

Upvotes: 2

Oray Kurt
Oray Kurt

Reputation: 9

I fix it.

>echo $HOSTNAME

xyz

>sudo gedit /etc/hosts

and

127.0.0.1 localhost

changed

127.0.0.1 xyz

it fixed it.

Upvotes: -1

L&#233;o R.
L&#233;o R.

Reputation: 2698

Change this import :

<artifactId>spring-boot-starter-parent</artifactId>

to this :

 <artifactId>spring-boot-starter</artifactId>

And after clean and re build maven

Upvotes: -1

Related Questions