Install and configure JavaSDK in Ubuntu

Source: Internet
Author: User
Install java under Ubuntu: Open the terminal under Ubuntu, run the following command, or use Adept/the new software manager to search for "sun-java6-jre" and "sun-java6-jdk" and tag the installation. Sudoapt-getinstallsun-java6-jre if the space is rich, it is recommended to install a JDK. Sudoapt-getinstallsun-java6-jdk tip:
  • Install java in Ubuntu:


Open the terminal under Ubuntu, run the following command, or use Adept/the new software manager to search for "sun-java6-jre" and "sun-java6-jdk" and tag the installation.

sudo apt-get install sun-java6-jre

If the space is rich, we recommend that you install a JDK.

sudo apt-get install sun-java6-jdk

Tip: During the installation process, you need to answer whether you agree to use the Protocol (the red-blue prompt page in the terminal). Press the tab key to OK, and press enter to install it normally.

  • Set the current default java interpreter and compiler:(Skip this step if multiple Java virtual machines are not installed in ubuntu9.10 .)
sudo update-alternatives --config java

The following figure is displayed after execution:

There are 2 alternatives which provide `java'.Selection Alternative-----------------------------------------------   # /usr/bin/gij-wrapper-4.1  *+ 2 /usr/lib/jvm/java-6-sun/jre/bin/javaPress enter to keep the default[*], or type selection number:

Enter the number before the row containing "sun. As shown above, enter 2 and press enter to confirm.

sudo update-alternatives --config javac

The operation is similar to the previous one.

  • Configure JAVA environment variables:
sudo gedit /etc/environment

Add the following two lines:

JAVA_HOME=/usr/lib/jvm/java-6-sunCLASSPATH=.:/usr/lib/jvm/java-6-sun/lib

To make the configuration take effect, you must restart the machine or enter

. /etc/environment
  • Configure the JVM priority:(Skip this step if multiple Java virtual machines are not installed in ubuntu9.10 .)
sudo gedit /etc/jvm

Convert

/usr/lib/jvm/java-6-sun

Enter this line at the top of the configuration block.

  • Install the browser's JAVA Plugin (recommended ):
sudo apt-get install sun-java6-plugin
  • Chinese font setting: If the font of the text tripod works, but spaces may appear, you can edit it.
/usr/lib/jvm/java-6-sun/jre/lib/fonts/fonts.dir

Add # To comment out all fonts before all Lucida. If you use a Custom font, create a link to/usr/lib/jvm/java-6-sun/jre/lib/fonts/fallback

Related Article

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.