【问题标题】:Sublime Text 2 Ant Build Target: [Error 2] The system cannot find the file specifiedSublime Text 2 Ant Build Target: [错误2] 系统找不到指定的文件
【发布时间】:2012-06-11 03:18:18
【问题描述】:

当我从 Sublime Text 2 (Ctrl+B) 运行基本 Ant Build 时,它可以工作,但它会运行所有目标。我想指定/覆盖默认构建目标。我添加了一个新的构建系统,例如:

{
    "cmd": ["ant", "my_target"]
}

但它失败了:

[Error 2] The system cannot find the file specified
[Finished]

怎么了?

【问题讨论】:

    标签: ant sublimetext2


    【解决方案1】:

    sublimetext buildsystems documentation page 展示了如何在 Windows 上创建一个特殊情况来执行“ant.bat”而不是“ant”。请参阅“特定于平台的选项”部分:

    windows、osx 和 linux 元素可让您提供特定于平台的 构建系统中的数据。这是一个例子:

    {
        "cmd": ["ant"],
        "file_regex": "^ *\\[javac\\] (.+):([0-9]+):() (.*)$",
        "working_dir": "${project_path:${folder}}",
        "selector": "source.java",
    
        "windows":
        {
            "cmd": ["ant.bat"]
        } 
    }
    

    在这种情况下,ant 将在除 Windows 之外的所有平台上执行, 将使用 ant.bat 代替。

    这有帮助吗?

    【讨论】:

    • 修复了我刚刚遇到的同样问题。谢谢!
    猜你喜欢
    • 2012-10-20
    • 2012-10-06
    • 1970-01-01
    • 1970-01-01
    • 2020-05-05
    • 1970-01-01
    • 2011-07-16
    • 1970-01-01
    • 2015-07-28
    相关资源
    最近更新 更多