在IntelliJ中运行ScalaTest会从classpath中删除除idea_rt.jar之外的所有内容

时间:2012-09-27 10:56:41

标签: intellij-idea scalatest

我正在尝试从IntelliJ运行ScalaTest测试用例

我在运行/调试配置对话框中指定要使用的类路径,这似乎正常。

但是,如果我尝试使用System.getProperty("java.class.path")查询此类路径 我只得到idea_rt.jar

除了我在集成测试中尝试这样做之外,这不会有问题:

val execArgs = Array("java", 
    "-classpath", 
    System.getProperty("java.class.path"), 
    mainClass, 
    args)

val process = Runtime.getRuntime.exec(execArgs)

当然,找不到我的mainClass

我的配置。

  • scalatest_2.9.2-1.8.RC1
  • IntelliJ IDEA 11.1.3
  • 阶库-2.9.2
  • scala插件版本0.5.977

1 个答案:

答案 0 :(得分:0)

如果你在Mac上,请尝试修改bin/idea.propertiesInfo.plist,将其设置为true

#---------------------------------------------------------------------
# Configure if a special launcher should be used when running processes from within IDE.
# Using Launcher enables "soft exit" and "thread dump" features
#---------------------------------------------------------------------
idea.no.launcher=true