spark-training icon indicating copy to clipboard operation
spark-training copied to clipboard

JAVA_HOME has to point to a JRE inside a JDK

Open sdrab opened this issue 6 years ago • 0 comments

I just tried to build the training ressources with mvn package and experienced the following error:

[INFO] hadoop-skeleton .................................... FAILURE [  0.697 s]
…
[ERROR] Failed to execute goal on project hadoop-skeleton: Could not resolve dependencies for project de.dimajix.training:hadoop-skeleton:jar:1.0.0: Could not find artifact jdk.tools:jdk.tools:jar:1.8 at specified path /usr/lib/jvm/java-8-openjdk-amd64/jre/../lib/tools.jar -> [Help 1]

My local solution was to set JAVA_HOME to a directory of a JRE that is located within a JDK. Thereafter, $JAVA_HOME/../lib/tools.jar (.. seems to go from the inner JRE into the outer JDK directory) can be successfully resolved and the build works on my machine.

I encountered this error on Windows 10 (that has this JDK/JRE-structure) as well as in my Ubuntu shell (that does not have this JDK/JRE-structure and I would have to create a symlink to satisfy the implicit assumption).

I see two possible solutions here:

  • fix the resolution of tools.jar
  • document the dependency to a JRE that is located inside a JDK in the README.md.

Hope this helps you, Stephan

sdrab avatar Apr 10 '18 06:04 sdrab