Java play application works despite errors - how to resolve these errors?

I just started with a game using an activator, I created a new game application using

activator new firstApp play-java 

Then I opened the game console using the activator and launched the application, the application worked fine. Then I opened the project in my intellij as SBT, the project was open and started showing errors.

there were lines in the routes file

 GET / controllers.HomeController.index GET /count controllers.CountController.count GET /message controllers.AsyncController.message 

These errors are caused by the fact that the method index, counter and message are not static. This is an obvious mistake, since we cannot call a static method like this, why the code application still works.

Another error I get is in code

 actorSystem.scheduler().scheduleOnce( Duration.create(time, timeUnit), () -> future.complete("Hi!"), exec ); 

He says this is an ambiguous method call.

My question is: if there are errors, why does the application work without

I created the launch configuration as an SBT task and tried to start the application, and I got a bunch of errors.

0
source share
1 answer

They worked for me:

Open the root \ build.sbt file and click "Import Project" or "Update Project". Open the project \ plugins.sbt file and click Import Project or Update Project.

This will lead to the need to import all the necessary libraries, and after the libraries are completed, it will be displayed in the project view panel "Tree of external libraries".

Go to File> Preferences, select "Play2" in the "Languages ​​and Frames" section. On the right side of the "Compiler" tab, check the "Use Play 2 compiler for this project" and "Apply settings" box.

0
source

Source: https://habr.com/ru/post/989131/


All Articles