Install JDK in Ubuntu 10.10 to configure eclipse and tomcat

Source: Internet
Author: User

This article from http://developer.51cto.com/art/201012/238581.htm

This article describes how to install JDK in Ubuntu 10.10 to configure eclipse and tomcat. If jdk1_is jdk-6u23-linux-i586.binyuntomcat的 is apache-tomcat-7.0.5.tar.gz.

51cto Editor's note: we have introduced how to configure the latest Ubuntu, JDK, and tomcat in "ubuntu JDK installation and configuration details.

51cto recommended topics: Ubuntu 11.04-agile killer whale

1. Install JDK

1.1 download the related JDK from the official website.

Here the download is jdk-6u23-linux-i586.bin.

: Http://www.oracle.com/technetwork/java/javase/downloads/index.html

1.2 create a "Java folder" in "Administrator personal folder"

That is, location-> main folder-> administrator;

Place the downloaded jdk-6u23-linux-i586.bin in this Java folder.

You can modify the path according to your actual situation. Here we use the Java folder under administrator as an example.

1.3 open "terminal"

Application> attachment> Terminal

Input:

 
 
  1. sudo sh jdk-6u23-linux-i586.bin 

(The user password to be entered may be encountered)

2. Set system variables in the java_home Environment

2.1. Here, CTRL + H can be used to view hidden files. It is a useful shortcut key.

Input:

 
 
  1. sudo gedit /etc/environment 

Add:

 
 
  1. export JAVA_HOME=/home/administrator/Java/jdk1.6.0_23 
  2. export JRE_Home=/home/administrator/Java/jdk1.6.0_23/jre 
  3. export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib 

That is


Set java_home Environment System Variables

2.2. Similarly, modify the second file

Input:

 
 
  1. sudo gedit /etc/profile 

Add the following statement before umask 022:

 
 
  1. export JAVA_HOME=/home/administrator/Java/jdk1.6.0_23 
  2. export JRE_HOME=/home/administrator/Java/jdk1.6.0_23/jre 
  3. export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib 
  4. export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin 

That is

2.3 log out of the user and check the JDK version.

Input:

 
 
  1. java -version 

That is


JRE and JDK are successfully installed.

3. Install eclipse.

3.1 download related eclipse from the official website.

Here the download is eclipse-jee-helios-SR1-linux-gtk.tar.gz (that is, Java ee ).

: Http://www.eclipse.org/downloads/

3.2. Place the downloaded eclipse-jee-helios-SR1-linux-gtk.tar.gz in the Java folder and decompress it.

Run the decompressed eclipse, that is


Run the decompressed eclipse

4. Install tomcat7.05

4.1 download Tomcat from the official website

Here the download is apache-tomcat-7.0.5.tar.gz.

: Http://tomcat.apache.org/

4.2 put the downloaded apache-tomcat-7.0.5.tar.gz in the Java folder, decompress and name it tomcat7

If you like to execute command lines, you can execute the command

(Decompress) sudo tar zxvf APACHE-Tomcat-7.0.5

(Named tomcat7) sudo mv apache-Tomcat-7.05 tomcat7

4.3 bind files under Tomcat 7 on the terminal

(CD Java/tomcat7/bin)

Here we use the vim editor or gedit,Input:

 
 
  1. sudo gedit catalina.sh 

When you enter:

 
 
  1. sudo vim catalina.sh 

Get

 
 
  1. cygwin=false 
  2. os400=false 
  3. darwin=false 
  4. case "`uname`" in 
  5. CYGWIN*) cygwin=true;; 
  6. OS400*) os400=true;; 
  7. Darwin*) darwin=true;; 

Add:

 
 
  1. JAVA_HOME=/home/administrator/Java/jdk1.6.0_23 
  2. JAVA_OPTS="-server -Xms512m -Xmx1024m -XX:PermSize=600M -XX:MaxPermSize=600m -Dcom.sun.management.jmxremote" 

Port 4.4 and tomcat7.0.5 (the default port of tomcat7.0.5 is 8080). If a conflict occurs, modify the port in the following file.

In the tomcat7/CONF/server. xml file:

 
 
  1. <Connector port="9090" protocol="HTTP/1.1"  
  2.            connectionTimeout="20000"  
  3.            redirectPort="8443" /> 

Change to 9090, or use 9090 here ).

4.5. the Java/tomcat7/bin folder has been entered.

Input:

 
 
  1. sudo ./starup.sh 

Start Tomcat 7.

If

 
 
  1. Using CATALINA_BASE:   /home/administrator/Java/tomcat7 
  2. Using CATALINA_HOME:   /home/administrator/Java/tomcat7 
  3. Using CATALINA_TMPDIR: /home/administrator/Java/tomcat7/temp 
  4. Using JRE_HOME:        /home/administrator/Java/jdk1.6.0_23 
  5. Using CLASSPATH:       /home/administrator/Java/tomcat7/bin/bootstrap.jar:/home/administrator/Java/tomcat7/bin/tomcat-juli.jar 

.

That is

Run http: // localhost: 9090:

4.6 if you want to disable Tomcat 7,

Enter:

 
 
  1. sudo ./shutdown.sh 

5. Summary

The configuration still requires some patience. You will always understand it when you practice more. Well, here is the Ubuntu JDK installation and configuration we bring to you. Ubuntu JDK installation and configuration are the only way for beginners. I hope you will like it.

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.