java 环境变量配置(ubuntu 以root用户启动eclipse)

windows java 环境变量配置

1JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_25

2.PATH=.;C:\Program Files (x86)\Java\jdk1.6.0_25\bin;

3.CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;


linux ubuntu 环境变量配置

修改 /etc/profile

export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

sudo source /etc/profile

修改 /etc/environment

sudo vi /etc/environment

export JAVA_HOME=/usr/local/java
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$JAVA_HOME/bin"





本文出自 “技术开发” 博客,谢绝转载!

你可能感兴趣的:(java,环境变量)