We are having some problems using maven under a strange unix-ish dev platform. The maven compiler plugin complains about not being able to find the tools.jar
due to weird JDK/JRE confusion in the default installed java.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:
2.5.1:compile (default-compile) on project xyz: Fatal error compiling:
tools.jar not found: our-java-home-dir/../lib/tools.jar -> [Help 1]
The ../lib/tools.jar
should really be lib/tools.jar
. The java installation (Java 7) seems to be a JDK but somehow java is detecting it as only a JRE, hence the confusion. In looking at what the java code is doing, it must be thinking that we have a JRE installation and is expecting JAVA_HOME
to be pointing to the jre
subdir of the real JAVA_HOME
. No amount of copying, symlinking, or other hackery seemed to work for us to get ../lib
to be the same as lib
.
We've seen a lot of similar questions on the intertubes but none were of much help. We were not able to reinstall Java or any solution like you would do on other platforms but it is supposed to be a full JDK and includes all of the j*tools down in the bin
subdirectory.