Source:network
最近每天在這三個作業系統中切換,常常會腦袋轉不過來卡住,不然就是在鍵盤對應上卡住,這次遇到的問題則是三個作業系統的JAVA_Home設定都差很多......(引言都呈現碎碎念狀態..囧rz..)
話說今天按這篇文章How-to: Develop CDH Applications with Maven and Eclipse在照表操課 ,結果遇到這個問題 Buiding Hadoop with Eclipse / Maven - Missing artifact jdk.tools:jdk.tools:jar:1.6,
原因就是Windows 和 Linux 和 Mac對於 JDK的目錄結構不太一樣 (其實只有Mac愛作怪....),所以我在網路上找到一篇利用Profile的方式,分別設定兩種對應的路徑。
<profiles>
<profile>
<id>windows_profile</id>
<activation>
<os>
<family>Windows</family>
</os>
</activation>
<properties>
<toolsjar>${java.home}/../lib/tools.jar</toolsjar>
</properties>
</profile>
<profile>
<id>osx_profile</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
</properties>
</profile>
</profiles>
Reference:
[1] jdk tools jar as maven dependency
[2] Apple Developer Tools for Java

沒有留言:
張貼留言