AD

change openjdk to Sun java

How to install the Java Runtime Environment from Java**

If a browser plugin and Java runtime are all that is required, as opposed to a full Java development environment, the Oracle (formerly Sun) Java Runtime Environment (JRE) RPMs work for all currently supported CentOS versions, and are arguably the most compatible with web pages that require a Java plugin. The Java versions shown below are current as of this writing. Always use the latest available version for your architecture (i386 32-bit or x86_64/amd64 64-bit) and adjust accordingly.

Java 1.7 is now available. It was reported as functional using the same procedure as below.

Java i386 JRE and plugin

Download the latest Linux RPM (self-extracting file), currently jre-6u30-linux-i586-rpm.bin, from java** 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.

Java x86_64 JRE and plugin

Download the latest Linux RPM (self-extracting file), currently jre-6u30-linux-x64-rpm.bin, from java** then as root install and configure the alternatives system and plugins:

# cd [download directory]
# sh ./jre-6u30-linux-x64-rpm.bin
# alternatives --config java
There are 4 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
   2           /usr/java/jre1.6.0_13/bin/java
   3           /usr/java/jre1.6.0_18/bin/java
*+ 4           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/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 4 versions were installed then:

# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 5
# alternatives --config java
There are 5 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
   2           /usr/java/jre1.6.0_13/bin/java
   3           /usr/java/jre1.6.0_18/bin/java
*+ 4           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   5           /usr/java/latest/bin/java
Enter to keep the current selection[+], or type selection number: 5
# java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_30)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

Create links in the Mozilla Plugins directory so Java will work in supported browsers such as Firefox.

# cd /usr/lib64/mozilla/plugins/
# ln -fs /usr/java/latest/lib/amd64/libnpjp2.so

Test browser

Exit Firefox if it is running and [re]start Firefox. Type "about:plugins" in the URL field. It should show Java enabled.

Verify installed version at Java**, Test installed version at Java** or at javatester**.

Remove old versions

Oracle recommends removing old Java versions as they represent a security risk if left installed. By default, the installation procedure above will not remove old versions so we must do this manually:

# rpm -qa jre\*
jre-1.6.0_13-fcs.x86_64
jre-1.6.0_18-fcs.x86_64
jre-1.6.0_30-fcs.x86_64
# rpm -e jre-1.6.0_18-fcs.x86_64 jre-1.6.0_13-fcs.x86_64

  • Java is a trademark of the Oracle Corporation.

  • This page created and maintained by PhilSchaffner. Other Wiki contributors are invited to make corrections, additions, or modifications.
标签:
分类: apue
时间: 2012-09-28

相关文章

  1. Under Ubuntu 9.10 OpenJDK.SUN JAVA environment and issues related to Chinese characters

    Ubuntu by default uses JAVA as the OpenJDK, JAVA support on the need to use software and website, there is no ...
  2. Ubuntu 9.10 under OpenJDK.SUN JAVA environment and issues related to Chinese fonts

    Ubuntu by default uses JAVA to OpenJDK, JAVA support for the need to use software and website, there is no big ...
  3. Java based - Xin Sun Java Chinese garbled about the cause of the problem (b)

    Java based - Xin Sun Java Chinese garbled about the cause of (b) On: Sun Xin Source: Sun Xin Publisher: admin ...
  4. 在 Ubuntu 12.04 安装 Sun Java

    $ sudo apt-add-repository ppa:flexiondotorg/java $ sudo apt-get update $ sudo apt-get install sun-java6-jre su ...
  5. Java based - Xin Sun Java Chinese garbled about the causes of (a)

    Java based - Xin Sun Java Chinese garbled about the cause of the problem (a) On: Sun Xin Source: Sun Xin Publi ...
  6. Sun Java关键漏洞暴露

    Critical Vulnerability in Sun Java Sun Java关键漏洞暴露 posted by David Adams on Tue 12th Jul 2011 19:08 UTC, submit ...
  7. Reprint: the Ubuntu in the change into the Sun version of Java

    Bahrain Sun's Java and found still running GNU version, read the link structure will probably be after the sus ...
  8. [Change] the use of JAVA in the dynamic proxy to achieve database connection pooling

    Database connection pool in the preparation of applications often need to use the module, too frequent in term ...
  9. Sun Java HotSpot ™ Virtual Machine and garbage collection memory model

    Previously the company's J2EE application as a result of visits increased by frequent crashes, traced and foun ...
  10. Fedora 13 Install the Sun Java

    If you feel that OpenJDK has been able to very efficiently run your program, do not look down. OpenJDK is inde ...
  11. Ubuntu 10.04 set up under the SUN JAVA development environment

    The following is installation and configuration steps Install open-jdk-6, sudo apt-get install open-jdk-6 (I d ...
  12. 微软与SUN(JAVA)在方向上的区别

    微软是做生意的.SUN是搞政治的.无形中比微软高了一个层次.SUN从来不专注于具体的技术,而是忙着制定一个又一个标准.这就是企业的社会意识. 一些人为了钱而活,如微软.而另一些人是为了理想而活,如SUN.也只有在美国,才 ...
  13. [Change] Easy way for Java Socket Programing

    Provider.java (TCP Server) import java.io.*; import java.net.*; public class Provider{ ServerSocket providerSo ...
  14. Change: Focus on Queue: Java 1.5 add a new data structure interface (SynchronousQueue)

    Reprinted: http://blog.csdn.net/Victor_Jan/archive/2004/09/27/117695.aspx Java 1.5 versions will ultimately be ...
  15. [Change] Android networked (2) - java. Net roaming

    Compared to C + +, JAVA programming advantages in the network is self-evident. At first the pain of learning M ...
  16. [Change] in-depth understanding of Java Generics

    Generic Java language, like C + + in the template. But this is only the surface-based phenomenon. Java languag ...
  17. Sun Java System Application Server command line to deploy war

    Start command cd / d% SUNAPP% \ bin asadmin.bat start-domain domain1 Close asadmin.bat stop-domain domain1 Dep ...
  18. centos卸载openjdk,安装sun的jdk

    先找出来 [email protected] soft]# rpm -qa | grep jdk java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64 java-1.6.0-openjdk-1.6 ...
  19. (Reprinted) Java will change what

    Ten years ago, almost no one imagined that a few technical staff developed a "small language", would ...