私は使用しています
- IntelliJ IDEA 126.330
- Scala プラグイン 0.7.142
- JVM1.6
- スカラ 2.10
- Windows 7 x64 の下で
Scalaを試してみることに決め、次のアプリケーションを書きました
object main {
def main(args: Array[String]) {
println("Hello, world!")
}
}
次に、Scala Console 実行構成を作成しました。実行しようとすると、コンソールに次の出力が表示されます
"C:\Program Files (x86)\Java\jdk1.6.0_32\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:16352,suspend=y,server=n -Djline.terminal=NONE -Dfile.encoding=UTF-8 -classpath "C:\work\scala-2.10.0-RC2\lib\scala-compiler.jar;C:\work\scala-2.10.0-RC2\lib\scala-library.jar;C:\work\scala-2.10.0-RC2\lib\scala-reflect.jar;C:\Users\root\.IntelliJIdea12\config\plugins\Scala\lib\scala-plugin-runners.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 126.330\lib\idea_rt.jar" org.jetbrains.plugins.scala.compiler.rt.ConsoleRunner -classpath "C:/Users/root/IdeaProjects/testScala/out/production/testScala;C:/work/scala-2.10.0-RC2/lib/scala-actors.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/jce.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/ext/localedata.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/resources.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/jsse.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/ext/sunjce_provider.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/rt.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/charsets.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/deploy.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/ext/dnsns.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/management-agent.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/ext/sunmscapi.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/javaws.jar;C:/work/scala-2.10.0-RC2/lib/scala-library.jar;C:/work/scala-2.10.0-RC2/lib/scala-swing.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/plugin.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/ext/sunpkcs11.jar;" -usejavacp2 -Y2log-classpath
Connected to the target VM, address: '127.0.0.1:16352', transport: 'socket'
Welcome to Scala version 2.10.0-RC2 (Java HotSpot(TM) Client VM, Java 1.6.0_32).
Type in expressions to have them evaluated.
Type :help for more information.
scala> <console>:5: error: object tools is not a member of package scala
var value: scala.tools.nsc.interpreter.IMain = _
^
<console>:6: error: object tools is not a member of package scala
def set(x: Any) = value = x.asInstanceOf[scala.tools.nsc.interpreter.IMain]
^
-usejavacp
グーグルで調べた後、パラメーターをアプリに渡すという提案が見つかりました。エラーを取り除くのに役立ちましたが、アプリケーションは実行されていません。コンソールに表示されるのは
"C:\Program Files (x86)\Java\jdk1.6.0_32\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:16383,suspend=y,server=n -Djline.terminal=NONE -Dfile.encoding=UTF-8 -classpath "C:\work\scala-2.10.0-RC2\lib\scala-compiler.jar;C:\work\scala-2.10.0-RC2\lib\scala-library.jar;C:\work\scala-2.10.0-RC2\lib\scala-reflect.jar;C:\Users\root\.IntelliJIdea12\config\plugins\Scala\lib\scala-plugin-runners.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 126.330\lib\idea_rt.jar" org.jetbrains.plugins.scala.compiler.rt.ConsoleRunner -classpath "C:/Users/root/IdeaProjects/testScala/out/production/testScala;C:/work/scala-2.10.0-RC2/lib/scala-actors.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/jce.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/ext/localedata.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/resources.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/jsse.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/ext/sunjce_provider.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/rt.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/charsets.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/deploy.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/ext/dnsns.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/management-agent.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/ext/sunmscapi.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/javaws.jar;C:/work/scala-2.10.0-RC2/lib/scala-library.jar;C:/work/scala-2.10.0-RC2/lib/scala-swing.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/plugin.jar;C:/Program Files (x86)/Java/jdk1.6.0_32/jre/lib/ext/sunpkcs11.jar;" -usejavacp -Y2log-classpath
Connected to the target VM, address: '127.0.0.1:16383', transport: 'socket'
Welcome to Scala version 2.10.0-RC2 (Java HotSpot(TM) Client VM, Java 1.6.0_32).
Type in expressions to have them evaluated.
Type :help for more information.
scala>
また、IDE オプションで Scala Compile Server を無効にしてみました。どちらも助けにはなりませんでした。
どうすれば修正できますか?