Docs

Documentation versions (currently viewingVaadin 25 (prerelease))

Setup the Project

Set up a new Vaadin project with the necessary dependencies and configuration.

In this section, you’ll set up the project that you’ll be using throughout this tutorial.

Prerequisites

You’ll need the following installed on your development machine:

  • Java Development Kit (JDK) 21 or newer

  • A Java IDE such as IntelliJ IDEA, Eclipse, or VS Code

If you need help installing these tools, refer to the Development Environment guide.

Important
Use Hotswap for Faster Development
It is recommended to use hotswap while developing Vaadin applications. Hotswap is the process of reloading changed classes in a running JVM without restarting the application. You can find IDE specific instructions for enabling hotswap in the Run a Project guide.

Create the Project

Go to Vaadin Start and create a new Vaadin project. Don’t include a sample view, as you’ll create your first view from scratch in the next step of the tutorial. After downloading the project, unzip it and open it in your IDE.

Add Dependencies

You’ll be working with an existing H2 database in the application. To connect to the database, you need to add the H2 database and Spring Data JDBC dependencies to your project.

Open the pom.xml file in the root of your project and add the following dependencies inside the <dependencies> section:

Source code
XML
<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>

Then refresh the project in your IDE to download the new dependencies.

Import the Database

To get started quickly, you’ll use an existing H2 database file that contains the necessary tables and some sample data. Download the following files into the src/main/resources directory of your project:

The schema.sql file contains the database schema, and the data.sql file contains sample data. Spring Boot automatically executes these files when the application starts, setting up the database for you.

Start the Application

To make sure everything is set up correctly, start the application from your IDE. Since the application doesn’t have any views yet, navigating to http://localhost:8080 should show a "No views found" page. You should not see any errors in the application console output.

Next Steps

Now that your project is set up, you’re ready to create your first Vaadin view. Proceed to the Build Your First Data List View step to continue the tutorial.