標籤:eclipse builder launch launch configuration could not be found wowza
前邊有篇部落格《Eclipse 報 "The builder launch configuration could not be found" 錯誤的解決辦法》介紹了 Eclipse 報錯 "The builder launch configuration could not be found" 的解決辦法,按那個辦法處理之後,發現不報錯了,但 ant 的自動構建沒了。這樣沒法接受。
看來逃避是解決不了問題呢。所以覺得《Eclipse 報 "The builder launch configuration could not be found" 錯誤的解決辦法》介紹的方法並不是很好。
本文將介紹在 Wowza 外掛程式開發時,如何在不去掉 ant 的自動構建的前提下(因為 Wowza Eclipse 外掛程式開發是基於 ant 構建的!),解決 Eclipse Wowza 外掛程式報 "The builder launch configuration could not be found" 的錯誤。關於 Wowza Eclipse IDE 支援請參考《Eclipse 安裝/更新 Wowza IDE 外掛程式的步驟》,關於 Wowza 外掛程式的開發可以參考部落格《使用 Wowza IDE 開發第一個 Wowza 伺服器擴充應用 -- 監控直播頻道》。
1. 按照《Eclipse 報 "The builder launch configuration could not be found" 錯誤的解決辦法》所述步驟執行,執行完後項目 Builders 如:
這時 Eclipse Wowza 項目已經沒有了自動構建功能。
2. Navigator 視圖下,編輯項目下的 .project 檔案,projectDescription 標籤下添加以下內容:
<natures><nature>com.wowza.wms.eclipse.sdk.WowzaMediaServerProNature</nature><nature>org.eclipse.jdt.core.javanature</nature></natures>
然後儲存。.project 如果原有natures 定義,刪除 —— 既然報了 "The builder launch configuration could not be found" 錯誤,肯定不對。儲存後的 .project 檔案如下:
<?xml version="1.0" encoding="UTF-8"?><projectDescription><name>cloud-rts</name><comment></comment><projects></projects><buildSpec><buildCommand><name>org.eclipse.jdt.core.javabuilder</name><arguments></arguments></buildCommand></buildSpec><natures><nature>com.wowza.wms.eclipse.sdk.WowzaMediaServerProNature</nature><nature>org.eclipse.jdt.core.javanature</nature></natures></projectDescription>
3. Package Explorer 視圖下右擊項目名 -> 選擇 Properties 菜單 -> 左側菜單樹點擊 Builders -> 點擊 New... 按鈕,彈出 Choose configuration type 對話方塊
4. 選擇 Ant Builder,然後點擊 OK 按鈕,彈出 Edit Configuration 對話方塊
5. Name 就用 Eclipse 給的預設的 New_Builder(當然你也可以自訂其他),Main 頁項下的 Buildfile 點擊 Browse Workspace... 按鈕,選擇你項目下的 build.xml 然後點 OK 按鈕
Main 頁項下的 Base Directory 點擊 Browse Workspace... 按鈕,選擇你的項目名,然後點擊 OK 按鈕
最後點擊 Edit Configuration 對話方塊的 Apply 和 OK 按鈕進行儲存
發現 Ant 的自動構建又回來了,已經成功解決掉 "The builder launch configuration could not be found" 錯誤:
6. 在 .project 檔案的 ant 的 triggers 中加入 auto。作者的 .project 檔案最終如下所示:
<?xml version="1.0" encoding="UTF-8"?><projectDescription><name>cloud-rts</name><comment></comment><projects></projects><buildSpec><buildCommand><name>org.eclipse.jdt.core.javabuilder</name><arguments></arguments></buildCommand><buildCommand><name>org.eclipse.ui.externaltools.ExternalToolBuilder</name><triggers>auto,full,incremental,</triggers><arguments><dictionary><key>LaunchConfigHandle</key><value><project>/.externalToolBuilders/New_Builder.launch</value></dictionary></arguments></buildCommand></buildSpec><natures><nature>com.wowza.wms.eclipse.sdk.WowzaMediaServerProNature</nature><nature>org.eclipse.jdt.core.javanature</nature></natures></projectDescription>