Trying to add "import" statement to my new scala project (I'm using IntelliJ 10.5.2 right now) syntax highlighter tells me that he cannot find java package:
import java.util.zip //Cannot resolve symbol java
object Main extends App {
override def main(args: Array[String]) {
}
}
What's wrong. What should I do to import this package?
If you want to import multiple classes from a Java package, you can use the usual Java import syntax: or you can use this Scala import syntax, if you prefer: import javax.swing.
In most cases your project JDK is not compatible with Scala or sbt version, try to change the Scala Compile Server SDK. Press Ctrl+Alt+S to open Settings/Preferences dialog.
Why am I unable to compile my Scala project? In most cases your project JDK is not compatible with Scala or sbt version, try to change the Scala Compile Server SDK. Press Ctrl+Alt+S to open Settings/Preferences dialog. From the options on the left, select Build, Execution, Deployment | Compiler | Scala | Scala Compiler Server.
Does IntelliJ IDEA support the sbt's model of integration tests? When you build sbt projects, keep in mind that the IDEA project model doesn't really have the same concept of configurations as sbt does, so only compile and test are fully supported. For other cases we recommend that you run the build from the integrated sbt shell.
Make sure that you have a Java SDK configured under:
File -> Project Structure -> Project -> Project SDK
See Where do I configure project JDK
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With