[root@nhserver1 usr]# java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (rhel-2.3.10.4.el6_4-i386)
OpenJDK Client VM (build 23.7-b01, mixed mode, sharing)
[root@nhserver1 usr]# rpm -qa | grep jdk
java-1.7.0-openjdk-1.7.0.25-2.3.10.4.el6_4.i686
java-1.6.0-openjdk-1.6.0.0-1.62.1.11.11.90.el6_4.i686
[root@nhserver1 usr]# yum -y remove java-1.7.0-openjdk-1.7.0.25-2.3.10.4.el6_4.i686
[root@nhserver1 usr]# yum -y remove java-1.6.0-openjdk-1.6.0.0-1.62.1.11.11.90.el6_4.i686
[root@nhserver1 usr]# java -version
-bash: /usr/bin/java: No such file or directory
从http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html上下载 jdk-7u45-linux-i586.rpm 安装包,然后放到服务器上。
[root@nhserver1 ~]# rpm -ivh jdk-7u45-linux-i586.rpm
[root@nhserver1 ~]# java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)
[root@nhserver1 ~]# vim /etc/profile
打开文件后,在export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC上面添加如下:
export JAVA_HOME=/usr/java/jdk1.7.0_45
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
[root@nhserver1 ~]#. /etc/profile
重新登陆root
[root@nhserver1 ~]# mkdir java
[root@nhserver1 java]# cd java
[root@esprit java]# vim HelloWorld.java
public class HelloWorld {
public static void main(String args[]) {
System.out.println( " Hello World in Linux!! " );
}
}
[root@nhserver1 java]# javac HelloWorld.java
[root@nhserver1 java]# java HelloWorld
Hello World in Linux!!
[root@nhserver1 java]# cd
进X window
[root@nhserver1 ~]# tar -zxvf pycharm-2.7.3.tar.gz
[root@nhserver1 ~]# cd pycharm-2.7.3
[root@nhserver1 pycharm-2.7.3]# cd bin
[root@nhserver1 bin]#
[root@nhserver1 bin]# python -V
Python 2.6.6
双击pycharm.sh后,输入序列号就可以打开pycharm了。然后打开新的python project,在Python Interpreters下配python的地址就可以用了。