Sublime Text 2 Ant Build Target: [Error 2] The system cannot find the file specified

那年仲夏 提交于 2019-12-13 04:16:17

问题


When I run the basic Ant Build from Sublime Text 2 (Ctrl+B), it works, but it runs all targets. I want to specify/override the default build target. I added a new build system like:

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

But it fails with:

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

Whats wrong?


回答1:


The sublimetext buildsystems documentation page show how you can make a special case to execute "ant.bat" instead of "ant" on Windows. See the section "Platform-specific Options":

The windows, osx and linux elements let you provide platform-specific data in the build system. Here’s an example:

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

    "windows":
    {
        "cmd": ["ant.bat"]
    } 
}

In this case, ant will be executed for every platform except Windows, where ant.bat will be used instead.

Does that help?



来源:https://stackoverflow.com/questions/10925547/sublime-text-2-ant-build-target-error-2-the-system-cannot-find-the-file-speci

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!