使用 Scala 插件在 IntelliJ Ultimate 13.1.1 中创建 SBT 项目没有新的>src/main/scala 的 Scala 对象?

编程入门 行业动态 更新时间:2024-10-26 02:24:38
本文介绍了使用 Scala 插件在 IntelliJ Ultimate 13.1.1 中创建 SBT 项目没有新的>src/main/scala 的 Scala 对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试开始使用 Scala 中的快速 Hello World 应用程序.

I'm trying to get started with a quick Hello World application in Scala.

我使用的是 IntelliJ Ultimate 13.1.1.我已经下载了 Scala 插件.我还下载了 SBT 插件.项目 SDK 为 Java 1.6.

I'm using IntelliJ Ultimate 13.1.1. I've downloaded the Scala plugin. I've also downloaded the SBT plugin. The project SDK is Java 1.6.

我继续创建了一个新项目.我选择了 SBT 项目.该项目创建良好.我注意到 src/main/* 和 src/test/* 文件夹创建得很好.

I went ahead and created a new project. I selected SBT Project. The project is created fine. I notice that the src/main/* and src/test/* folders are created nicely.

当我右键单击 src/main/scala 文件夹并尝试创建一个新的 Scala 对象时,没有这样做的选项吗?!我试图将目录标记为源根目录.尽管如此,问题仍然存在.我可以选择创建 Java 文件,但不能创建 Scala 文件.

When I right-click on the src/main/scala folder and try to create a new Scala object, there's no option to do so?! I tried to mark the directory as a sources root. Still, the issue persists. I'm given the option to create a Java file but not a Scala file.

这是怎么回事?!在过去的两个小时里,我一直在为此烦恼.

What's going on?! I've been pulling my hair on this for the past two hours.

推荐答案

这是 IntelliJ 中的一个错误.这是我提交的错误报告 (#25058) 的答案:

This is a bug in IntelliJ. Here is the answer to a bug report (#25058) I submitted:

Andrey Dernov(JetBrains 支持)3月26日19:43

Andrey Dernov (JetBrains Support) Mar 26 19:43

请看开发者的回复:

戴夫,问题(主要)是因为大写字母(youtrack.jetbrains/issue/SCL-6853).您可以使用小写项目名称,或等待修复的新插件构建问题.感谢您的错误报告!

Hi Dave, the problem was (mostly) because of the uppercase letter (youtrack.jetbrains/issue/SCL-6853). You can either use lowercase project name, or wait for a new plugin build that fixes the issue. Thank you for the bug report!

您可以通过显式编辑 Run -> Edit Configurations 并添加要运行的类来绕过它.设置主类并删除$(对象).

You can get around it by explicitly editing the Run -> Edit Configurations and adding the class that you want to run. Set the main class and delete the $ (for the object).

更多推荐

使用 Scala 插件在 IntelliJ Ultimate 13.1.1 中创建 SBT 项目没有新的>src/main/scala 的 Sca

本文发布于:2023-07-24 13:18:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1203681.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:插件   对象   项目   Ultimate   IntelliJ

发布评论

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

>www.elefans.com

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