在家編譯一個Apache的開源項目,在編譯時遇到錯誤以下:java
error: error while loading <root>, error in opening zip file [ERROR] error: error while loading <root>, error in opening zip file error: scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found. at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:16) at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:17) at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:48) at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:40) at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:61) at scala.reflect.internal.Mirrors$RootsBase.getPackage(Mirrors.scala:172) at scala.reflect.internal.Mirrors$RootsBase.getRequiredPackage(Mirrors.scala:175) at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackage$lzycompute(Definitions.scala:183) at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackage(Definitions.scala:183) at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackageClass$lzycompute(Definitions.scala:184) at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackageClass(Definitions.scala:184) at scala.reflect.internal.Definitions$DefinitionsClass.AnnotationDefaultAttr$lzycompute(Definitions.scala:1024) at scala.reflect.internal.Definitions$DefinitionsClass.AnnotationDefaultAttr(Definitions.scala:1023) at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreClasses$lzycompute(Definitions.scala:1153) at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreClasses(Definitions.scala:1152) at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode$lzycompute(Definitions.scala:1196) at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode(Definitions.scala:1196) at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1261) at scala.tools.nsc.Global$Run.<init>(Global.scala:1290) at scala.tools.nsc.Driver.doCompile(Driver.scala:32) at scala.tools.nsc.Main$.doCompile(Main.scala:79) at scala.tools.nsc.Driver.process(Driver.scala:54) at scala.tools.nsc.Driver.main(Driver.scala:67) at scala.tools.nsc.Main.main(Main.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org_scala_tools_maven_executions.MainHelper.runMain(MainHelper.java:161) at org_scala_tools_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
當時編譯的是開源的Carbondata項目,使用maven3.3.9,jdk是1.8。因而到網上各類搜索和查詢看到各類答案,可是都沒有能解決問題。其中有個提示說有多是jar包損壞致使打開時出錯。因而把全部的maven庫的jar全刪掉從新編譯,OK編譯成功。(也能夠寫代碼檢查哪一個jar包壞了)sql
可是jar包爲何會損壞呢? 我回顧了下編譯過程,原來在一開始編譯時常常下載jar包很慢,在下載的過程當中直接中斷從新,多是這個緣由致使的。apache
編譯好後開始運行代碼又報以下錯誤session
Starting CarbonExample using spark version 1.5.2 Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rw-rw-rw- at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:522) at org.apache.spark.sql.hive.client.ClientWrapper.<init>(ClientWrapper.scala:171) at org.apache.spark.sql.hive.HiveContext.executionHive$lzycompute(HiveContext.scala:162) at org.apache.spark.sql.hive.HiveContext.executionHive(HiveContext.scala:160) at org.apache.spark.sql.hive.HiveContext.<init>(HiveContext.scala:167) at org.apache.spark.sql.CarbonContext.<init>(CarbonContext.scala:41) at org.apache.carbondata.examples.util.ExampleUtils$.createCarbonContext(ExampleUtils.scala:44) at org.apache.carbondata.examples.CarbonExample$.main(CarbonExample.scala:27) at org.apache.carbondata.examples.CarbonExample.main(CarbonExample.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rw-rw-rw- at org.apache.hadoop.hive.ql.session.SessionState.createRootHDFSDir(SessionState.java:612) at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:554) at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:508) ... 13 more
又是各類搜索,有的說要下載正確的winutils.exe,有的說要用命令winutils.exe 給目錄賦權限,有的說裝了xxx軟件衝突。。。。各類都作了仍是一樣的錯誤。最後重啓一把(重啓機器)好了app
淚奔。。。。。。。maven