Я получаю это сообщение об ошибке в моем проекте Java. Как решить? Я просто строю стандартный пример приложения типа Vaadin. Я хочу попробовать включить JavaScript в мой проект. Но уже простая аннотация выдает сообщение об ошибке: @JavaScript не является типом аннотации
Я пробовал это: Project-> Properties-> JavaCompiler-> AnnotationProcessing-> Enable Все еще ошибка. Может быть, я должен включить некоторые .jars?
![enter image description here](https://i.stack.imgur.com/BSGWM.png)
Вот код:
package my.vaadin.app;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.annotations.*;
/**
* This UI is the application entry point. A UI may either represent
* a browser window
* (or tab) or some part of an HTML page where a Vaadin application
* is embedded.
* <p>
* The UI is initialized using {@link #init(VaadinRequest)}. This
* method is intended to be
* overridden to add component to the user interface and initialize
* non-component functionality.
*/
@Theme("mytheme")
@JavaScript("javascript-test.js")
public class MyUI extends UI {
@Override
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
final TextField name = new TextField();
name.setCaption("Type your name here:");
Button button = new Button("Click Me");
button.addClickListener(e -> {
layout.addComponent(new Label("Thanks " + name.getValue()
+ ", it works!"));
});
layout.addComponents(name, button);
setContent(layout);
}
@WebServlet(urlPatterns = "/*", name = "MyUIServlet",
asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode =
false)
public static class MyUIServlet extends VaadinServlet {
}
}