首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不带参数的蚂蚁集platforms.JDK_1.6.home

不带参数的蚂蚁集platforms.JDK_1.6.home
EN

Stack Overflow用户
提问于 2013-04-12 08:38:59
回答 1查看 3.2K关注 0票数 2

我在windows机器上运行ant遇到了问题。我得到以下错误:

代码语言:javascript
复制
BUILD FAILED
C:\Users\USER\testing\mercurial\project\NetbeansProject\nbproject\build-impl.xml:111: The J2SE Platform is not correctly set up.
 Your active platform is: JDK_1.6, but the corresponding property "platforms.JDK_1.6.home" is not found in the project's properties files.
 Either open the project in the IDE and setup the Platform with the same name or add it manually.
 For example like this:
     ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.JDK_1.6.home" in a .properties file)
  or ant -Dplatforms.JDK_1.6.home=<path_to_JDK_home> jar (where no properties file is used)

如果我执行ant -Dplatforms.JDK_1.6.home=%JAVA_HOME%,它可以很好地执行,但是,有什么方法可以避免每次我需要构建程序时都添加这个参数吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-04-12 11:21:30

我认为在命令行或构建脚本显式加载的属性文件之外设置ant属性是不可能的。

如果您正在寻找一种不太繁琐的方式来启动ant,请尝试使用包装器.bat文件或分配别名doskey ant=ant "-Dplatforms.JDK_1.6.home=%JAVA_HOME%"

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15961231

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档