I want to change maven java home which is open jdk with sun jdk. How can I do it ?
root@ak-EasyNote-TM98:~# mvn -version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
Default locale: tr_TR, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-34-generic", arch: "amd64", family: "unix"
Edit:
So sorry. I forgot to write the below code :
root@ak-EasyNote-TM98:~$ java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
My java home default path is sun jdk already. But maven java home has pointed openjdk. I want to fix it only for maven.
which java
which will tell you which binary of java is being called. In my case it was/usr/bin/java
. At this point you can runreadlink -f /usr/bin/java
, which for me yielded/usr/lib/jvm/java-7-oracle/jre/bin/java
ergoexport JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre/
– Jasminejason