Configuring the Java Environment in Ubuntu 12.04 (install JDK, Tomcat, MAVEN, Eclipse)

Source: Internet
Author: User

1. Installing JDK 1.7

Install JDK 1.7 By default in Ubuntu (/USR/LIB/JVM/JAVA-7-OPENJDK-AMD64)

If not available for download: Wget-c http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz or

Http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u4-downloads-1591156.html

  Unzip: sudo tar zxvf jdk-7u5-linux-x64.tar.gz-c/USR/LIB/JVM

Modify environment variables: sudo gedit/etc/profile

Add at the end:

# for Java
Export JAVA_HOME=/USR/LIB/JVM/JAVA-7-OPENJDK-AMD64
Export JRE_HOME=${JAVA_HOME}/JRE
Export Classpath=.:${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin:${jre_home}/bin: $PATH

Source/etc/profile//Enable configuration to take effect or restart your computer

Configuring the default JDK version

sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/java-7-sun/bin/java 300

sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/java-7-sun/bin/javac 300

sudo update-alternatives--config java//Select the desired version

Java-version//Detect if the JDK is successfully installed

Java Version "1.7.0_85"
OpenJDK Runtime Environment (IcedTea 2.6.1) (7u85-2.6.1-5ubuntu0.12.04.1)
OpenJDK 64-bit Server VM (build 24.85-b03, Mixed mode)

2. Installing Tomcat 7

3. Install Maven

4. Install Eclipse

Configuring the Java Environment in Ubuntu 12.04 (install JDK, Tomcat, MAVEN, Eclipse)

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.