Error: No views found - Add a view to get started.

I just wanted to test something simple using Vaadin.
I downloaded the starter project from here:
After importing it to Visual Studio Code I wrote this simple code:

package com.vaadin.demo.flow.application.mainview;

import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.html.Paragraph;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;

public class HelloWorldView extends VerticalLayout {
  public HelloWorldView() {
    var toolbar = new HorizontalLayout(
        new Button("Button 1"),
        new Button("Button 2"),
        new Button("Button 3")
        new Paragraph("Paragraph 1"),
        new Paragraph("Paragraph 2"),
        new Paragraph("Paragraph 3")

It cannot be compiled correctly. I don’t see the buttons in my localhost page.
Instead it shows the message which I included as image.

The path of your route is vertical-layout

http://localhost:8080/vertical -layout

I’m more worried about.

It cannot be compiled correctly.
If it doesn’t compile then you should fix the compilation error

My mistake, I just wanted to tell you that I will get the error message, after running/compiling it. That’s what I meant.

It still shows the error.

Did you perhaps changed the white list setting in

What do you mean?

vaadin.whitelisted-packages = com.vaadin,org.vaadin,dev.hilla,com.example.application

Just wanted to be sure the view package matches the list. It seems ok

And you confirm the application main class is in a parent package of the view?

But where is the problem?

The route is not registered.

And how can I do that?

That should work automatically, there might be an issue in the structure of the project or something else. Can you post you project structure?

Yes, I do. Give me few seconds.


With the src/java folder opened

Just a guess “com.vaadin” is excluded from route scanning to improve performance?

I don’t know but that’s usually a wrong package name