使用 Scala 插件在 IntelliJ Ultimate 13.1.1 中创建 SBT 项目没有新的>src/main/scala 的 Scala 对象? [英] Creating SBT Project in IntelliJ Ultimate 13.1.1 with Scala plugin gives no New > Scala object for src/main/scala?

查看:20
本文介绍了使用 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

请看开发者的回复:

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

Hi Dave, the problem was (mostly) because of the uppercase letter (http://youtrack.jetbrains.com/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 的 Scala 对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆