Install the Java Development Environment on fedora 16

Source: Internet
Author: User

Due to developer issues, sun's JVM is difficult to install and configure on Fedora Linux. Here we are talking about Sun's JVM (andJDK) Is the official implementation version, not other reference implementation. Here I will teach you how to easilyFedora
Linux
16 install aboveJDK7. The detailed steps are as follows:

1. Download JDK


Download the appropriate version, specifically 32-bit or 64-bit. Skip the table and directly go to the installation step.


Ii. Installation


2.1 Modify permissions

chmod u+x jdk-7u2-linux-i586.rpm


2.2 Installation

sudo -ivh jdk-7u2-linux-i586.rpm 


2.3 update System Configuration

Now you need to find the real location for JDK installation and instruct fedora to accept your choice.
Enter the following command:

sudo updatedb;locate javac |grep bin

You will see items like this (of course, there will also be a default installed Java file ):

/usr/java/jdk1.7.0_02/bin/javac 

Here/usr/Java/jdk1.7.0 _ 02 is the real java_home of your machine. Note this because you will need it to run the subsequent commands.

Now you need to run the alternatives command to instruct fedora to recognize Sun's JVM.

sudo alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_02/bin/java 100sudo alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0_02/bin/jar 100sudo alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0_02/bin/javac 100 

If necessary, you can specify other Java executable programs in the same format.

 
Note: If the alternatives command is not in your path, you can use locate alternatives to locate it.

Finally, we need to configure alternative to use sun's JVM as the default JVM. Enter the following command:

sudo /usr/sbin/alternatives --config java 

It will show you at least two options. Select the Sun JVM option. The same process is repeated for other commands.

Now you have updated the configuration for most of the applications that call JVM on fedora. Enter Java-version and you will see the following output:

java version "1.7.0_02"Java(TM) SE Runtime Environment (build 1.7.0_02-b13)Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)

Note: This method is effective for most JVM calling applications on fedora, except tomcat. The default installed Tomcat is hard-coded using gcj JVM. I modified its configuration file but it didn't work. My solution is to directly install the Tomcat ora version of Tomcat from the Tomcat website. In this case, you only need to modify the value of java_home to point to the location where we installed it, and it will work correctly.


References:

Http://www.qqread.com/java/2007/10/b372427.html

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.