Newbie problem with IntelliJ installation

Hi,

I'm trying to start using Scala on Windows 7 64-bit. I just installed Scala 2.10.3 (from .msi file), Java SDK 7u40 and IntelliJ 12.1.6. I added scala and sbt plugins. I can run Scala from command line. I used new project wizard to create test program and added scala-compiler.jar and scala-library.jar. I'm getting "Scala instance doesn't exist or is invalid" error when I try to compile a my program. When I look at Project Structure->Libraries, I see errors in libraries: "invalid classes roots", "invalid sources roots", etc. It looks like a typical configuration problems. Any clues what is wrong?

Here is the beginning of error messages:

scala: Error: Scala instance doesn't exist or is invalid:
    version unknown, library jar: C:\Program Files (x86)\scala\bin\lib\scala-library.jar, compiler jar: C:\Program Files (x86)\scala\bin\lib\scala-compiler.jar
sbt.InvalidScalaInstance: Scala instance doesn't exist or is invalid:
    version unknown, library jar: C:\Program Files (x86)\scala\bin\lib\scala-library.jar, compiler jar: C:\Program Files (x86)\scala\bin\lib\scala-compiler.jar

...


Thank you,
Paul

2 comments

OK, I found that the paths are invalid, e.g. C:\Program Files (x86)\scala\bin\lib\scala-library.jar doesn't exist. It should be: C:\Program Files (x86)\scala\lib\scala-library.jar. I'm trying to find out why this path was generated.

...

I edited the path of these libraries in Project Structure->Libraries, so the Name text box shows the correct path, but the tree below still shows incorrect paths in red. I don't see any other place where I can edit these paths.

0

I found the problem: Scala Home was set wrong.

I generated a new Scala HelloWorld project (using New Project->Scala Module) and now I'm getting another kind of error messages:

"C:\Program Files\Java\jdk1.7.0_40\bin\java" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 12.1.6\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.7.0_40\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\jce.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\jfxrt.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\resources.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\rt.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\ext\zipfs.jar;C:\Program Files (x86)\scala\lib\scala-library.jar;C:\Program Files (x86)\scala\lib\scala-swing.jar;C:\Program Files (x86)\scala\lib\scala-actors.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 12.1.6\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain HelloWorld
Exception in thread "main" java.lang.ClassNotFoundException: HelloWorld
 at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:190)
 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)

Process finished with exit code 1

0

Please sign in to leave a comment.