Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows Ant set platforms.JDK_1.6.home不带参数_Windows_Ant_Properties_Java_Java Home - Fatal编程技术网

Windows Ant set platforms.JDK_1.6.home不带参数

Windows Ant set platforms.JDK_1.6.home不带参数,windows,ant,properties,java,java-home,Windows,Ant,Properties,Java,Java Home,我在windows计算机上运行ant时遇到问题。我得到以下错误: 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 "platform

我在windows计算机上运行ant时遇到问题。我得到以下错误:

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)
生成失败
C:\Users\USER\testing\mercurial\project\NetbeansProject\nbproject\build impl.xml:111:未正确设置J2SE平台。
您的活动平台是:JDK_1.6,但在项目的属性文件中找不到相应的属性“platforms.JDK_1.6.home”。
在IDE中打开项目并使用相同的名称设置平台,或者手动添加。
例如:
ant-Duser.properties.file=jar(将属性“platforms.JDK_1.6.home”放在.properties文件中)
或者ant-Dplatforms.JDK_1.6.home=jar(不使用属性文件)

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

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


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

在调用之前是否尝试过添加
?我只需要在一台计算机上解决此问题,因此无法修改生成文件。是否有办法在整个系统内定义此属性?