Install JDK under ubuntu10.04

Source: Internet
Author: User

Today, we will give you the JDK installation steps over the past few days.

 

Install JDK first, because Sun's JDK has been removed from the official source since Ubuntu 10.04, so you need to download the binfile from sun. I use a 64-bit system, so I need to download the binfile named "Linux x86_64.
 
Sun provides the following installation instructions:
 
1. download the file.
 
2. Create the/usr/lib/JVM/Java directory, copy the downloaded file to this directory, and enter the/usr/lib/JVM/Java directory.

 

 

 

3. Set the running permission

Run the following command:

% Chmod + x 6u <version>-linux-x64.bin
 
4. decompress the file.
 
Run the command: %./jdk-6u <version>-linux-x64.bin
 
The JDK file will be decompressed to a directory named jdk.6.0 _ <version> in the current path.
 
5. Run sudo gedit/etc/environment to add the configuration.

Path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/lib/JVM/Java/jdk.6.0 _ <version>/bin"
Classpath = ".:/usr/lib/JVM/Java/jdk1.6.0 _ 25/bin/lib"
Java_home = "/usr/lib/JVM/Java/jdk1.6.0 _ 25"
 
Run
 
./Etc/environment
 
Then input the following in the command line:
 
Java-version
 
Java version "1.6.0 _ 25"
Java (TM) se Runtime Environment (build 1.6.0 _ 25-b06)
Java hotspot (TM) 64-bit server VM (build phases 0-b11, mixed mode)
 
OK. JDK has been installed.
 
---------------- Split line -------------- another article ----------------
 
There are two types of Java, one of which is the Ubuntu source with open-Java (icedtea). openjdk is a group established by Sun to develop the Java SE Open Source implementation. One is an oracle sun-java6. The former is Ubuntu's default Java, where sun-java6 is used.
 
Currently, the Java source of ubuntu 11.04 has not been updated and cannot be installed officially. There are two solutions:
 
A. install Java (JRE/JDK and Java INS) in ubuntu11.04 using the software libraries related to Ubuntu 10.10)
 
Add Source
Add-Apt-repository "Deb http://archive.canonical.com/lucid partner"

Note: If the system prompts no add-Apt-repository command, install Python-software-properties and run sudo apt-Get install Python-software-properties first. In addition, some Ubuntu versions of www.linuxidc.com do not have the add-Apt-repository command even if Python-software-properties is installed. In this case, you need to manually add this line "Deb
Http://archive.canonical.com/ubuntu maverick partner "to the/etc/APT/sources. list file .)
 
Manually add source method
VI/etc/APT/source. List
 
Deb http://archive.canonical.com/Ubuntu maverick partner"

Install Java JDK
Apt-Get update
Apt-Get install sun-java6-jdk
Note: 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.

If you want to install Java JRE and Java Plugin, run the following command:
Apt-Get install sun-java6-jre sun-java6-plugin
B. install Java in ubuntu11.04 using PPA
 
Use the Ubuntu PPA Method for installation. First add the source:
Add-Apt-repository PPA: ferramrobert to/Java
Install Java JDK
Apt-Get update
Apt-Get install sun-java6-jdk
To install Java JRE and Java Plugin, run the following command:
Apt-Get install sun-java6-jre sun-java6-plugin
Note: PPA is short for personal package archive. It is a source service provided by the Ubuntu Launchpad website that allows individual users to upload software source code, compile through Launchpad and release it as a binary software package, which serves as an apt/new source for other users to download and update. PPA is a collection of software not included in Ubuntu by default. Www.linuxidc.com usually focuses on a single program, but they can also contain more content, depending on the maintainer of these repositories. A ppa may be concerned with an unpublished software. PPA provides updates to your favorite software at a much faster speed than Ubuntu itself.
 
Set the current default Java interpreter and compiler (skip this step if multiple Java virtual machines are not installed)
Update-Java-alternatives-s Java-6-sun
C. Configure Java environment variables
VI/etc/environment
 
Java_home =/usr/lib/JVM/Java-6-sun
Classpath =.:/usr/lib/JVM/Java-6-sun/lib
Run the following command to make the configuration take effect:
./Etc/environment

Tomcat is a servlet container developed by the Jakarta project under the Apache Software Foundation. According to the technical specifications provided by Sun Microsystems, Tomcat supports Servlet and JavaServer Page (JSP, it also provides some special functions as Web servers, such as Tomcat Management and Control Platform, security domain management, and tomcat valve. Because Tomcat itself contains an HTTP server, it can also be considered as a separate web server. Apache Tomcat contains a configuration management tool, which can be configured by editing the configuration file in XML format. At present, the latest version is 7.0.

 

 

 

Ii. install Tomcat
 
A. Get the tomcat installation package
Wget

Http://apache.etoak.com/tomcat/tomcat-7/v7.0.14/bin/apache-tomcat-7.0.14.tar.gz

B. decompress and install
Mkdir-P/usr/local/webserver/
Tar xvzf apache-tomcat-7.0.14.tar.gz-C/usr/local/webserver/
# Rename the installation directory
CD/usr/local/webserver/
Mv apache-Tomcat-7.0.14/tomcat
C. Set tomcat to run as an independent user
# Add a system user Tomcat and set it as not logged on to the system.
Useradd-D/usr/local/webserver/tomcat-S/usr/sbin/nologin Tomcat
D. Set Tomcat's access permissions to the Tomcat directory.
Chown-r tomcat. tomcat/usr/local/webserver/tomcat/e, configure the Tomcat environment variable VI/etc/environment
 
Catalina_base =/usr/local/webserver/tomcat
Catalina_home =/usr/local/webserver/tomcat
Tomcat_user = Tomcat
Run the following command to make the configuration take effect:
./Etc/environment
F. start Tomcat
/Usr/local/webserver/tomcat/bin/startup. Sh
 
Using catalina_base:/usr/local/webserver/tomcat
Using catalina_home:/usr/local/webserver/tomcat
Using catalina_tmpdir:/usr/local/webserver/tomcat/temp
Using jre_home:/usr
Using classpath:/usr/local/webserver/tomcat/bin/Bootstrap. jar:/usr/local/webserver/tomcat/bin/tomcat-juli.jar

G. Test
 
Access http: // ip: 8080/. If you see the default Tomcat interface, it indicates that the operation is successful.
 
H. Stop Tomcat

/Usr/local/webserver/tomcat/bin/shutdown. Sh
I. Set the Tomcat Administrator Account
 
Add the following content before the tag
Nano/usr/local/webserver/tomcat/CONF/tomcat-users.xml
 
<Role rolename = "Admin-Gui"/>
<Role rolename = "Admin-script"/>
<Role rolename = "Manager-Gui"/>
<Role rolename = "Manager-script"/>
<Role rolename = "Manager-JMX"/>
<Role rolename = "Manager-status"/>
<User Username = "admin" Password = "000000" roles = "Manager-Gui, Manager-script, Manager-JMX, Manager-status, admin-script, admin-Gui "/>

After saving and closing, run Tomcat again and enter the user name and password set above. www.linuxidc.com will log on to the Tomcat Management page.

J. Run Tomcat as a daemon
 
According to official Tomcat requirements, jsvc is required for running Tomcat as a daemon.
 
Install jsvc

CD/usr/local/webserver/tomcat/bin/
Tar xvzf commons-daemon-native.tar.gz
CD commons-daemon-1.0.5-native-src/Unix/
./Configure
Make
CP jsvc ../..
CD ../..
Run the following command to run tomcat in the daemon
 
CD/usr/local/webserver/tomcat/
 
Access http: // ip: 8080/. If you see the default Tomcat interface, it indicates that the operation is successful.
 
K. Set startup Tomcat
 
This is intended to be set to boot in the daemon mode. Study N for a long time. Use the following method for the time being!
  
Edit/etc/rc. Local and add the Startup Script

VI/etc/rc. Local
 
/Usr/local/webserver/tomcat/bin/startup. Sh
Restart and access http: // ip: 8080/. If the default Tomcat interface is displayed, the operation is successful.

 

 

 

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.