add the following to your ~/.mavenrc
:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/{jdk-version}/Contents/Home
Second Solution:
echo export "JAVA_HOME=\$(/usr/libexec/java_home)" >> ~/.bash_profile
More Related Contents:
- React on global hotkey in a Java program on Windows/Linux/Mac?
- Maven 3.3.1 ECLIPSE: -Dmaven.multiModuleProjectDirectory system propery is not set
- Run a Java Application as a Service on Linux
- Adding external library to artifact jar in IntelliJ IDEA
- Surefire is not picking up Junit 5 tests
- What is the maven-shade-plugin used for, and why would you want to relocate Java packages?
- Compile and execute a JDK preview feature with Maven
- Maven: How to change path to target directory from command line?
- Cannot load R xlsx package on Mac OS 10.11
- Using Eclipse Java Compiler (ecj) in maven builds
- Distinguishing between Java threads and OS threads?
- Jetty 11 Doesn’t Detect Servlets
- java.lang.IllegalAccessError: tried to access method com.google.common.util.concurrent.SimpleTimeLimiter. when using Selenium-Java 3.5.1 or above
- Difference between maven plugins ( assembly-plugins , jar-plugins , shaded-plugins)
- Mac OS X 10.6.7 Java Path Current JDK confusing
- Java/JDK for the Apple Silicon chips
- Access maven properties defined in the pom
- How to download SNAPSHOT version from maven SNAPSHOT repository?
- How do you organize tests in a modular Java project?
- Why so red? IntelliJ seems to think every declaration/method cannot be found/resolved
- How to compile using -Xlint:unchecked in a Maven project?
- Configure Sonar to exclude files from Maven pom.xml
- Java is installed, in listing, but execution produces “./java: No such file or directory”
- Generating hashCode() and equals() when creating Java classes using Mojo Jaxb2 maven plugin
- How to add ojdbc7 to Java web app by Gradle?
- GSON is not being imported into the maven project
- Difference between the maven-assembly-plugin, maven-jar-plugin and maven-shade-plugin?
- Proper fix for Java 10 complaining about illegal reflection access by jaxb-impl 2.3.0?
- Maven- No plugin found for prefix ‘spring-boot’ in the current project and in the plugin groups
- Application is using Java 6 from Apple instead of Java 7 from Oracle on Mac OS X?