Install Sun JDK 6 on Fedora 14

Source: Internet
Author: User
Http://www.icycandy.com/blog/install-sun-jdk-6-on-fedora-14

 

The default Java version installed on Fedora 14 is OpenJDK. In most cases, OpenJDK is enough, but in some cases Sun JDK is necessary.

1. Download
The latest version is JDK 6 Update 22, http://www.oracle.com/technetwork/java/javase/downloads/index.html, select jdk-6u22-linux-i586-rpm.bin on the download page.

2. Installation

# Switch to root user su # Install JDKsh/some/path/jdk-6u22-linux-i586-rpm.bin # install java, javac and so on ## java ## alternatives -- install/usr/bin/java/usr/java/jdk1.6.0 _ 22/jre/bin/java 20000 # javaws (32-bit only) # alternatives -- install/usr/bin/javaws/usr/java/jdk1.6.0 _ 22/jre/bin/javaws 20000 # Firefox browser plug-in 32-bit alternatives -- install/usr/ lib/mozilla/plugins/libjavaplugin. so libjavaplugin. so/usr/java/jdk1.6.0 _ 22/jre/lib/i386/libnpjp2.so 20000 # Firefox browser plug-in 64-bit alternatives -- install/usr/lib64/mozilla/plugins/libjavaplugin. so libjavaplugin. so. x86_64/usr/java/jdk1.6.0 _ 22/jre/lib/amd64/libnpjp2.so 20000 # install javacalternatives -- install/usr/bin/javac/usr/java/jdk1.6.0 _ 22/ bin/javac 20000 # Switch the default Java # Run the following command, select the just-installed Sun JDKalternatives -- config java # Check the current Java version to see if the switch is successful.

3. Set Environment Variables
If you only use Eclipse or NetBeans, you do not need to set environment variables because it will automatically detect the java path in the system. However, if some software cannot automatically detect the path, you need to set environment variables, such as Tomcat.

# If you want the setting to be valid for all users, edit the file/etc/profilevim/etc/profile # or edit the file if you want the setting to be valid only for the current user ~ /. Bash_profilevim ~ /. Bash_profile

Add the following content at the end of the edited File

export JAVA_HOME="/usr/java/jdk1.6.0_22"export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:/lib.dt.jarexport PATH=$JAVA_HOME/bin:$PATH

Save the file after editing, and enter the following command to make the settings take effect.

Source/etc/profile # or source ~ /. Bash_profile

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.