java on CentOS
4059 단어 centos
Java i386 JRE and plugin
Download the latest Linux RPM (self-extracting file), currently jre-6u30-linux-i586-rpm.bin, from java.com then as root install and configure the alternatives system and plugins:
# cd [download directory] # sh ./jre-6u30-linux-i586-rpm.bin # alternatives --config java There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- *+ 1 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java 2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java Enter to keep the current selection[+], or type selection number:
Note number of versions, N, and use N+1 (if there is no output from the previous command, just imagine that N=0) - For example, if 2 versions were installed then:
# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 3 # alternatives --config java There are 3 programs which provide 'java'. Selection Command ----------------------------------------------- *+ 1 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java 2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java 3 /usr/java/latest/bin/java Enter to keep the current selection[+], or type selection number: 3 # java -version java version "1.6.0_30" Java(TM) SE Runtime Environment (build 1.6.0_30) Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
Create links in the Mozilla Plugins directory so Java will work in supported browsers such as Firefox.
# cd /usr/lib/mozilla/plugins/ # ln -fs /usr/java/latest/lib/i386/libnpjp2.so
Skip to the section on testing the browser plugin. CentOS, Debian/Ubuntu method
But by default OpenJDK based java was installed in my system.
[root@server2 sandbox]# java -version java version “1.6.0_17″ OpenJDK Runtime Environment (IcedTea6 1.7.9) (rhel-1.36.b17.el6_0-x86_64) OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
Step 1: Donwload JDK from http://www.java.com. I got JDK version 7 in rpm format.
mohamed@SilentStorm $ ls *.rpm jdk-7-linux-x64.rpm
Step 2: Install the RPM.
[root@server2 sandbox]# rpm -i jdk-7-linux-x64.rpm Unpacking JAR files… rt.jar… jsse.jar… charsets.jar… tools.jar… localedata.jar…
By default Java will be installed to /usr/java/jdk1.7.0/
Step 3: Add this new java to the alternatives configuration & Update the java alternatives
[root@server2 sandbox]# alternatives - -install /usr/bin/java java /usr/java/jdk1.7.0/bin/java 2 [root@server2 sandbox]# alternatives – -config java
There are 3 programs which provide ‘java’.
Selection Command ———————————————– *+ 1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java 2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java 3 /usr/java/jdk1.7.0/bin/java
Enter to keep the current selection[+], or type selection number: 3
Step 4: Now verify the java version
[root@server2 sandbox]# java -version java version “1.7.0″ Java(TM) SE Runtime Environment (build 1.7.0-b147) Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
OpenSUSE way is here
# rpm -i jdk-7-linux-i586.rpm Unpacking JAR files… rt.jar… jsse.jar… charsets.jar… tools.jar… localedata.jar… plugin.jar… javaws.jar… deploy.jar…
# update-alternatives – -install /usr/bin/java java /usr/java/jdk1.7.0/bin/java 2 # update-alternatives – -config java
There are 3 alternatives which provide `java’. Selection Alternative ———————————————– *+ 1 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java 2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java 3 /usr/java/jdk1.7.0/bin/java Press enter to keep the default[*], or type selection number: 3 Using ‘/usr/java/jdk1.7.0/bin/java’ to provide ‘java’. # java -version java version “1.7.0″
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
CentOS 7에서 OpenLDAP 서버 설치 및 구성LDAP(Lightweight Directory Access Protocol)는 ID와 개체를 쉽게 관리할 수 있는 디렉터리 서비스입니다. Windows 세계에서 서버는 일반적으로 Active Directory입니다...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.