今天本来想安装一个phpstorm编辑器的。然而环境不支持,系统默认的是jdk1.7 那好吧……
(CentOS 6.5 i386)然后去官网下载:
wget http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-i586.tar.gz
[root@localhost ~]# rpm -qa | grep java
javapackages-tools-3.4.1-6.el7_0.noarch
tzdata-java-2014i-1.el7.noarch
java-1.7.0-openjdk-headless-1.7.0.71-2.5.3.1.el7_0.x86_64
java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el7_0.x86_64
python-javapackages-3.4.1-6.el7_0.noarch
卸载OpenJDK,执行以下操作:
[root@localhost ~]# rpm -e --nodeps tzdata-java-2014i-1.el7.noarch
[root@localhost ~]# rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.71-2.5.3.1.el7_0.x86_64
[root@localhost ~]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el7_0.x86_64
在 usr/里创建一个文件夹,解压到java文件夹中:
mkdir /usr/java
tar -zxf jdk-8u91-linux-i586.tar.gz /usr/java
修改环境变量:
i /etc/profile
添加如下代码:
JAVA_HOME=/usr/java/
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar
export JAVA_HOME PATH CLASSPATH
立即生效:
source /etc/profile
安装成功。
[root@localhost 桌面]# java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) Client VM (build 25.91-b14, mixed mode)
[root@localhost 桌面]# ./PhpStorm-145.1616.3/bin/phpstorm.sh
Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=250m; support was removed in 8.0
六月 25, 2016 12:20:24 上午 java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
六月 25, 2016 12:20:24 上午 java.util.prefs.FileSystemPreferences$6 run
WARNING: Prefs file removed in background /root/.java/.userPrefs/prefs.xml
[ 181807] WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: editor for id: editor.preferences.import
[ 202912] WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: editor for id: editor.preferences.import
phpstorm成功运行。