Using SBT for Java only project
已回答
Hi,
I have installed Scala to get the SBT support. However, when I go to create a new Java project per the Help page (I am not using Scala) SBT is not an option. How do I go about enabling SBT for my Java project?
Thanks!
The help I am following is: https://www.jetbrains.com/idea/help/getting-started-with-sbt.html
请先登录再写评论。
Hi, because such a use case is quite rare, the UI is only Scala-specific. You can either:
Maybe we should add such an option to the project creation wizard.
Thanks, I will probably go with option 2.
I would recommend either adding it to the wizard or just removing (or update) the reference to Java projects from the Help to avoid confusion. Right now it sounds like SBT should be an option for java projects after installying Scala.
This is definitely an odd situation and is because of an external requirement. It is not something I would normally be trying to do. Before yesterday I had never heard of SBT.
To whom it may concern: Creating a Scala SBT project and then simply creating Java classes seems to work just fine. If you rename the package `src/main/scala` to `src/main/java` you need to run `sbt` in the terminal in the project folder or `reload` from the sbt shell window. But I just created a Main class and a test via JUnit. So my claim could be wrong.