idea scala 跑_无法在intellij IDE中的scala中找到或加载主类

bd96500e110b49cbb3cd949968f18be7.png

I have searched for this error, but the answers were for Java,

but my case is Scala. I am trying to run this project in IntelliJ IDE

sentimenAnalysis, but it throws an error. This is also the structure of the project. Class Not found

Update 1 According to answers, Adding $ at the end of the name of search class

Wx0Ha.png

Update 2 after adding sbt task:

V9eNA.png

Update 3

My problem was resolved by importing the project, instead of getting it directly from GitHub, probably the manual configuration that Mike Allen said could resolve the problem, but I couldn't successfully apply that.

解决方案

Probably you imported project somehow wrong. I see scala folder is not highlighted as sources.

Usually, you don't even need to setup Run configuration manually for Scala SBT project. Do you have Scala and SBT Plugins in your IDE?

You should open SBT projects through "Import project" and choose "build.sbt" file. I would also recommend enabling auto-import to install all of the dependicies.

That's how it look for me:

F4pBN.png

If you still wanna make it manually your configuration should work. That's my Run configuration that works:

juhE0.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值