Closed sunmingtao closed 1 year ago
Posted answer here: https://stackoverflow.com/questions/30329108/mojoexecutionexception-while-doing-a-build-maven
This issue happened on my Mac.
I used JAVA_HOME=/usr/libexec/java_home -v 1.8
to switch to JDK 8
echo $JAVA_HOME
shows
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
Turns out this JDK version is problematic.
I fixed it by using JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_341.jdk/Contents/Home
(after installing an official JDK8)
Now echo $JAVA_HOME
shows
/Library/Java/JavaVirtualMachines/jdk1.8.0_341.jdk/Contents/Home
Building a project with Java 8 shows error