linux 常用操作

1. Change the file permission as follows.
chmod a+x jdk-xx-xxx.bin
2. Run the bin file to start the installation.
./jdk-xx-xxx.bin

Unpacking...
Checksumming...
Extracting...
...
...
A directory will be created under "/usr/java" with the JDK version name, which will consists of all the jdk files.

3. You can export the Java home to create it as an environment variable.
export JAVA_HOME=/usr/java/jdk1.6.x_xx
export PATH=$JAVA_HOME/bin:$PATH
4. you can verify the JDK version installed on your system by issuing the following command.
which java

# chmod +x jdk-6u23-linux-i586-rpm.bin    //给所有用户添加可执行的权限
   或
# chmod 755 jdk-6u23-linux-i586-rpm.bin   //更改文件权限为755


使用echo命令检查jdk环境变量配置情况。
# echo $JAVA_HOME
# echo $CLASSPATH
# echo $PATH

卸载Linux自带的jdk
不卸载,可能使用jdk的时候,使用的是自带的。
在终端shell下执行命令:
rpm -qa | grep gcj
会列出一些东西如:java-1.4.2-gcj-compat-1.4.2.0-27jpp等,删除含有java字串的软件包
rpm -e --nodeps java-1.4.2-gcj-compat-1.4.2.0-27jpp
或者在Applications->Add and Remove Software中找到java开头的包进行删除。
--------------------------------------------------------------------------

你可能感兴趣的:(linux)