spring boot run with eclipse tomcat

697 views java

Hi i'm trying to start spring boot with eclipse tomcat.
but it is fail all of it.
also i searched same issue in here stackoverflow but it was not helped to me.

i'm using eclipse and my plug-in is
- BuildShip Gradle Integration 2.0
- Spring Tools 3 Add-On 3.9.6 RELEASE

and i make my project with spring boot
Type : gradle (BuildShip 2.x)
Packaging : War
Java Version : 8
Language : Java

and here is my build.gradle

buildscript {
    ext {
        springBootVersion = '2.1.0.RELEASE'
    repositories {
    dependencies {

apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'war'

group = 'heykj.web'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {

configurations {

dependencies {
    //providedCompile "javax.servlet:javax.servlet-api:4.0.1"

and this is my application class

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

public class PlusFApplication extends SpringBootServletInitializer {

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

    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(PlusFApplication.class);


and my project facets
enter image description here

i don't understand this is not work.. i think eclipse tomcat can't find Main Class.. and i added servlet-api but it doesn't work.
how can i?

answered question

How are you running your application, and do you have any errors ?

Springboot by default runs on tomcat server so can you please remove the tomcat dependency and run your application once again.

1 Answer


Spring Boot has a built in web-server, it is run as a Java executable, so no need for Tomcat.

Simply right click on the PlusFApplication class and Run As -> Spring Boot App

posted this

Have an answer?


Please login first before posting an answer.