2014-12-06 42 views
0

我正在處理涉及擴展Spark項目的事情。我使用Spark的make-distribution.sh,併成功地從github上的代碼構建jar。然而,當我包括罐作爲依賴和編譯的IntelliJ的是:建設和包括火花時不好的符號參考

package org.apache.spark 
object Main extends App{ 
    println(org.apache.spark.util.Utils.random.nextInt()) 
} 

我得到一個編譯錯誤:

Error:scalac: bad symbolic reference. A signature in Utils.class refers to term util in package com.google.common which is not available. It may be completely missing from the current classpath, or the version on the classpath might be incompatible with the version used when compiling Utils.class.

誰能告訴我,什麼是怎麼回事錯在這裏?謝謝你的幫助!路加福音

回答

0

錯誤消息說,你scalac找不到com.google.common package.util:

Utils.class取決於一包 「com.google.common」 「UTIL」。

com.google.common不適用於您的scalac。

該包可能完全從當前類路徑丟失。

或者類路徑上的版本可能與編譯Utils.class時使用的版本不兼容。

檢查如何解決sparc項目的依賴性。