首页 > 代码库 > 查看环境变量CLASSPATH, PATH ,JAVA_HOME-------->mac

查看环境变量CLASSPATH, PATH ,JAVA_HOME-------->mac

                                            终端(命令行)操作

推荐两篇博客:http://elf8848.iteye.com/blog/1582137

                  http://blog.csdn.net/done58/article/details/51138057

查看 JAVA_HOME    命令->set | grep JAVA

技术分享

添加JAVA_HOME:export JAVA_HOME=$(/usr/libexec/java_home)

 

 

 

查看 PATH 命令->echo $PATH

技术分享

 添加 PATH export PATH=/Users/snowing/Downloads/apache-maven-3.5.0/bin:$PATH

 

 

 

查看 CLASSPATH:命令->set | more

技术分享

添加 $export CLASSPATH=${CLASSPATH}:/Users/snowing/Downloads/apache-tomcat-9.0.0.M18/lib/servlet-api.jar

 

MAC 修改host文件 

-------------------------------------------------------

sudo vi /etc/hosts

查看环境变量CLASSPATH, PATH ,JAVA_HOME-------->mac