Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
212 views
in Technique[技术] by (71.8m points)

Module SDK for Scala in IntelliJ Idea

How do you create Module SDK in Project Settings / Modules / Dependencies for Scala in IntelliJ Idea?

question from:https://stackoverflow.com/questions/4773784/module-sdk-for-scala-in-intellij-idea

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'm assuming you mean Project Structure -> Modules -> Dependencies

You can just click on the Add... button in that view. A "Module" here is simply a Jar file or directory containing classes.

You wouldn't normally do this though. A better approach is:

  • Create the project using Maven and the maven-scala-plugin, then import it as a Maven project into IntelliJ

or

  • Create the project using SBT, and use the SBT IDEA plugin to generate the IntelliJ project

Either way, the correct dependencies will then be created for you.

UPDATE

Based on your comment, it looks as though your problem is that IntelliJ doesn't know where to find the Java SDK (this is nothing to do with modules, it just happens to appear in that window)

Under Project Structure -> Project, you'll see an option for "Project SDK" with the value "" highlighted in red.

Click the new button beside this, select "jsdk", and point it to the directory where you installed the Java SDK.

Then all should be good.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...