【问题标题】:Running ScalaTest in IntelliJ removes everything but idea_rt.jar from classpath在 IntelliJ 中运行 ScalaTest 会从类路径中删除除了 idea_rt.jar 之外的所有内容
【发布时间】:2012-09-27 10:56:41
【问题描述】:

我正在尝试从 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
  • scala-library-2.9.2
  • scala 插件版本 0.5.977

【问题讨论】:

    标签: intellij-idea scalatest


    【解决方案1】:

    如果您使用的是 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
    

    【讨论】:

    • 编辑 Info.plist 会破坏应用签名。当然,他们也阅读了一个外部文件。 (我尝试将它作为 -D 放在 idea.vmoptions 中,但很惊讶它不起作用。)
    猜你喜欢
    • 2018-11-24
    • 2010-11-26
    • 2020-10-30
    • 2017-12-09
    • 2017-05-04
    • 2015-06-27
    • 2012-08-01
    • 1970-01-01
    • 2012-12-03
    相关资源
    最近更新 更多