Running an Application
- Overview
- Eclipse IDE
To run your application, all you need to do is to run the Application class that contains the main method that starts Spring Boot. Eclipse automatically detects that you have such a class with a main() method and lets you run it.
To start your application, you can do any of the following:
Click Run Application (“play” icon) in the toolbar.
Select **Run › Run** in the menu.
Press Ctrl+F11.
Select the in the Project Explorer, right-click, and select **Run As › Java Application**.
The first time you start a Vaadin application, it downloads frontend dependencies and builds a JavaScript bundle. This can take several minutes, depending on your computer and internet speed.
You will know that your application has started when you see the following output in the console:
Show code
Expand code
You can now open the web application in a browser at localhost:8080.
To run the application in an embedded web server, you need to create a run configuration, a shortcut to run a task in Eclipse, in this case a Maven goal.
You can create such a run configuration as follows:
Select **Run As › Maven build**.
-
Technology Stack Embedded Server Goal to Run Spring Boot
–
spring-boot:run
CDI / Java EE
Apache TomEE
Plain Java
Jetty
jetty:run
Optionally, you can also give the run configuration a new name.
Click Run to save the new configuration and execute it.
You should see the Console view with the log generated by the application and the server.
You can now open the web application in a browser at .
-
You can also enable Live Reload to have the page refreshed automatically.
Once the run configuration is created, you can deploy and run the web application by clicking the Run (or Debug) icon in the toolbar and selecting the corresponding run or debug configuration:
The Eclipse IDE has built-in integration with Maven. You can run common commands such as or mvn jetty:run
without having to leave the IDE.
The project is built with Maven, and you can also run it in an embedded development server with Maven, as described later.
The most common commands are available in the Run As and Debug As folders when you right-click the project in the Project Explorer panel.
For example, to compile the project and install it your local Maven repository, right-click the project and select **Run As › Maven install**:
After starting the command, you will see how Eclipse executes the goal and all the previous phases in the Maven’s default lifecycle. Building the application downloads dependencies from the and copies the generated artifacts into your local Maven repository among other things.
You can find additional useful options in the Maven sub menu.
- The key concepts in Maven, see .