簡體   English   中英

您的活動平台是:default_platform,但未找到相應的屬性“platforms.default_platform.home”

[英]Your active platform is: default_platform, but the corresponding property "platforms.default_platform.home" is not found

我目前正在開發 JavaFX 應用程序。 我以前使用 Netbeans 7.4,但現在我切換到 Netbeans 8.0.2。 使用新的 IDE 運行我的項目后,出現錯誤消息:

C:\projects\client\QueueBoard\nbproject\build-impl.xml:87: The J2SE Platform is not correctly set up.
Your active platform is: default_platform, but the corresponding property "platforms.default_platform.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.default_platform.home" in a .properties file)
or ant -Dplatforms.default_platform.home=<path_to_JDK_home> jar (where no properties file is used)
BUILD FAILED (total time: 0 seconds)

你如何解決這個問題?

解決此問題的最簡單方法是:

  1. 在NetBeans中打開項目
  2. 打開該項目的項目設置
  3. 檢查(並可能糾正/修復)所有設置(包括平台設置)
  4. 單擊設置對話框中的保存/確定
  5. 清潔+建造項目

這樣,project-settings-file將更新為當前設置。

干杯!

我知道這是一個非常古老的問題,但我最近遇到了這個問題。 我想出的解決方案是修改用戶可編輯的build.xml文件(通常是 build-impl.xml 的一個目錄)並在 build- build-impl.xml<import>之后添加以下內容:

<property name="platforms.default_platform.home"
          location="${java.home}/.."/>

這允許任何用戶/本地設置具有優先權,但如果未定義,則使用的 java 應該與正在執行 Ant 的 java 相同。

這個問題在 Netbeans 15 中仍然存在,可以通過更新nbproject/private/private.properties文件並確保此行存在來解決:

javac.debug=true

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM