运行软件java运行错误怎么解决,尽管有错误,Java播放应用程序仍在运行 - 如何解决此错误?...

I just started with play using activator, I created new play app using

activator new firstApp play-java

Then I opened play console using activator and run the application, app was running fine.

Then I opened the project in my intellij as SBT, the project opened and started showing errors.

in routes file there were lines

GET / controllers.HomeController.index

GET /count controllers.CountController.count

GET /message controllers.AsyncController.message

This errors are because method index, count and message are not static.

This is an obvious error since we cannot call to static method like this, why the code application is still running.

another error I am getting is in code

actorSystem.scheduler().scheduleOnce(

Duration.create(time, timeUnit),

() -> future.complete("Hi!"),

exec

);

It says this is an ambiguous method call.

My question is, if there are errors why application is running without

I created run configuration as SBT task and tried to run the app an I got bunch of errors.

解决方案

These worked for me:

Open file root\build.sbt and click 'Import Project' or 'Refresh Project'.

Open file project\plugins.sbt and click 'Import Project' or 'Refresh Project'.

This will import all required libraries and after completing libraries will be visible under project view pane 'External Libraries' tree.

Go to File > Settings, select 'Play2' under 'Languages & Frameworks'.

Under right side Compiler tab check 'Use Play 2 compiler for this project' and Apply settings.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值