2012-08-10 108 views
11

我試圖按照this tutorial,但我有進口問題。缺少的庫com.sun.tools.attach

我:

The import com.sun.tools cannot be resolved 

符合

import com.sun.tools.attach.VirtualMachine; 

我試圖尋找太陽/ Oracle的網站上的一些信息,但我沒有發現任何有用的。

我正在JDK 1.6.0_31上開發。

回答

11

tools.jar需要被添加到IDE中的庫路徑和程序的類路徑。 tools.jar文件位於JDK的lib目錄中。

例如,如果JDK安裝在C:\Program Files\Java\jdk1.7.0_11中,則tools.jar文件將在C:\Program Files\Java\jdk1.7.0_11\lib\tools.jar處找到。

4

您應該將tools.jar添加到您的classpath