Navigation :
Set - Env - JDK - Maven - ubuntu
Set env for JDK and Maven ubuntu
- Edit /etc/profile
- add below lines to the bottom
#set maven env
export M2_HOME=/usr/local/apache-maven-3.6.1
export CLASSPATH=$CLASSPATH:$M2_HOME/lib
export PATH=$PATH:$M2_HOME/bin
#set Java environment
export JAVA_HOME=/usr/lib/jdk1.8.0_191
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
- activate the changes
/etc/profile
- Edit bashrc
- add below lines in the front
#set maven env
export M2_HOME=/usr/local/apache-maven-3.6.1
export CLASSPATH=$CLASSPATH:$M2_HOME/lib
export PATH=$PATH:$M2_HOME/bin
#set Java environment
export JAVA_HOME=/usr/lib/jdk1.8.0_191
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
- activate the changes