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:
- 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:
- sudo gedit /etc/environment
Add:
- export JAVA_HOME=/home/administrator/Java/jdk1.6.0_23
- export JRE_Home=/home/administrator/Java/jdk1.6.0_23/jre
- 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:
- sudo gedit /etc/profile
Add the following statement before umask 022:
- export JAVA_HOME=/home/administrator/Java/jdk1.6.0_23
- export JRE_HOME=/home/administrator/Java/jdk1.6.0_23/jre
- export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
- 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:
- 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:
- sudo gedit catalina.sh
When you enter:
- sudo vim catalina.sh
Get
- cygwin=false
- os400=false
- darwin=false
- case "`uname`" in
- CYGWIN*) cygwin=true;;
- OS400*) os400=true;;
- Darwin*) darwin=true;;
Add:
- JAVA_HOME=/home/administrator/Java/jdk1.6.0_23
- 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:
- <Connector port="9090" protocol="HTTP/1.1"
- connectionTimeout="20000"
- redirectPort="8443" />
Change to 9090, or use 9090 here ).
4.5. the Java/tomcat7/bin folder has been entered.
Input:
- sudo ./starup.sh
Start Tomcat 7.
If
- Using CATALINA_BASE: /home/administrator/Java/tomcat7
- Using CATALINA_HOME: /home/administrator/Java/tomcat7
- Using CATALINA_TMPDIR: /home/administrator/Java/tomcat7/temp
- Using JRE_HOME: /home/administrator/Java/jdk1.6.0_23
- 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:
- 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.