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

编程入门 行业动态 更新时间:2024-10-25 18:28:52
本文介绍了无法在intellij IDE中的scala中找到或加载主类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经搜索过这个错误,但答案是Java,,但我的情况是Scala。我试图在IntelliJ IDE

$ b添加sbt任务后$ b

更新2 :

更新3 我的问题是通过导入项目解决的,而不是直接从GitHub获取,可能是Mike Allen说的可以解决问题的手动配置,但我无法成功申请那个。

解决方案

可能你输入的项目有点不对劲。我看到scala文件夹没有突出显示为源。 通常,您甚至不需要为Scala SBT项目手动设置运行配置。 您的IDE中是否有Scala和SBT插件?

您应该通过导入项目打开SBT项目并选择build.sbt文件。我还建议启用自动导入来安装所有依赖项。

这就是我的看法:

如果您仍想手动制作,您的配置应该有效。这是我的运行配置有效:

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

Update 2 after adding sbt task:

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:

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

更多推荐

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

本文发布于:2023-11-25 05:51:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628571.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   中找到   intellij   IDE   scala

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!