gpt4 book ai didi

windows - Ant 设置 platforms.JDK_1.6.home 不带参数

转载 作者:可可西里 更新时间:2023-11-01 10:26:26 26 4
gpt4 key购买 nike

我在尝试在 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)

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

最佳答案

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

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

关于windows - Ant 设置 platforms.JDK_1.6.home 不带参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15961231/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com