Ant – Unable to locate tools.jars. Expected to find it in

在完成安裝Ant之後
嘗試在Command Prompt上執行Ant 看看安裝/設定有沒有問題
很可惜當我執行 ant時 他出現以下的錯誤信息
Unable to locate tools.jars. Expected to find it in

Unable to locate tools.jars. Expected to find it in
做了一會research後發現..
這應該是Environment Variables /環境變數 設定的問題
所以我便到
Advanced System Settings/進階系統設定” -> “Advanced tab/進階 分頁” ->”Environment Variables / 環境變數” 按一下
在之前的網誌有介紹如何修改”Environment Variables / 環境變數” 有興趣的朋友可以到以下網誌參考
How to install Ant on Windows – 如何在Windows 上安裝Ant

之後選擇”JAVA_HOME” -> Edit/修改
把原先設定下的JAVA_HOME path
C:\Program Files\Java\jdk1.7.0_45\bin
Environment Variables -> JAVA_HOME Path

轉成
C:\Program Files\Java\jdk1.7.0_45
Environment Variable -> JAVA_HOME Path without bin folder

便解決了 “Unable to locate tools.jars. Expected to find it in” 的問題了
Solved: Unable to locate tools.jars. Expected to find it in

Hope you find it useful

Leave a Reply