Install and configure JDK, Tomcat 5.5, and eclipse3.2 in Linux

Source: Internet
Author: User
Tags gtk
About how to configure the Java Development Environment in Linux Article Many, but mostly incomplete. Today, I will write a complete and detailed description. Including jdk1.5, tomcat5.5, and eclipse3.2. Even if you do not understand anything (basic level), you can build a project as long as you follow the steps in the document.


Step 1: Download Required Software

    • Download jdk1.5. Download Page: http://java.sun.com/j2se/1.5.0/download.jsp
    • Download tomcat5.5. Download webpage: http: // tomcat.apache.org
    • Download eclipse3.2. Download Page: http://www.eclipse.org/downloads/
    • Download the Eclipse plug-in cdt3.1. Download Page: http://www.eclipse.org/cdt/downloads.php
    • Download the Eclipse plug-in tomcatpluginv32. Download Page: http://www.sysdeo.com/eclipse/tomcatPlugn

 

Step 2: Install the downloaded software
Suppose you download all the software you want to download in the/home/user/downloads directory.

    • Install jdk1.5 first.

1. Open the terminal and run the command su root to switch to the Super User.
2. Switch CD to the/home/user/downloads directory. Run Command CP jdk-1_5_0_04-nb-4_1-linux.bin/opt to copy JDK to/OPT directory.
3. Switch CD to the/OPT directory. Run the command chmod A + x jdk-1_5_0_04-nb-4_1-linux.bin to grant corresponding permissions.
4. Run the command./jdk-1_5_0_04-nb-4_1-linux.bin wait, follow the prompts to install JDK, assuming the installation in the/OPT directory. It can also be in/usr/local. I am used to/OPT. JDK installation is complete.

    • Then install tomcat5.5

1. Switch CD to the/home/user/downloads directory. Run Command CP apache-tomcat-5.5.20.tar/opt to copy it to the/OPT directory.
2. Switch CD to the/OPT directory. Run the command tar xvf apache-tomcat-5.5.20.tar to decompress it in the/OPT directory. Tomcat5.5 installation is complete.

    • Install eclipse3.2

1. Switch CD to the/home/user/downloads directory. Run Command CP eclipse-SDK-3.2.1-linux-gtk.tar.gz/opt to copy it to the/OPT directory.
2. Switch CD to the/OPT directory. Run the command tar xvf eclipse-SDK-3.2.1-linux-gtk.tar.gz to decompress it. Eclipse3.2 installation is complete.

    • By now, the software has been installed, but it cannot be run. You need to configure the software.

 

Step 3: Configure Environment Variables


First, run the command VI/etc/profile to display the profile file. Source code .
Press "I" on the keyboard to enter the insert mode.
Insert the following in the profile file: Code :
Java_home =/opt/jdk1.5.0 _ 04
Classpath = $ classpath: $ java_home/lib: $ java_home $/JRE/lib
Tomcat_home =/opt/tomcat
Export java_home classpath tomcat_home
The source file code is as follows:
#/Etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in/etc/bashrc
Pathmunge (){
If! Echo $ PATH |/bin/egrep-Q "(^ |:) $1 ($ |:)"; then
If ["$2" = "after"]; then
Path = $ path: $1
Else
Path = $1: $ path
Fi
Fi
}
# Path manipulation
# If ['id-U' = 0]; then
Pathmunge/sbin
Pathmunge/usr/sbin
Pathmunge/usr/local/sbin
# Fi
Pathmunge/usr/x11r6/bin after
Unset pathmunge
# No core files by default
Ulimit-s-c 0>/dev/null 2> & 1

User = "'id-UN '"
LOGNAME = $ user
Mail = "/var/spool/mail/$ user"

Hostname = '/bin/hostname'
History Size = 1000

If [-z "$ inputrc"-! -F "$ home/. inputrc"]; then
Inputrc =/etc/inputrc
Fi

Java_home =/opt/jdk1.5.0 _ 04
Classpath = $ classpath: $ java_home/lib: $ java_home $/JRE/lib
Tomcat_home =/opt/tomcat

Export path user LOGNAME mail hostname histsize inputrc

Java_home classpath tomcat_home

For I in/etc/profile. d/*. Sh; do
If [-R "$ I"]; then
. $ I
Fi
Done
Unset I
Export g_broken_filenames = true
The black part is the insert code.
After the insertion is complete, Press ESC. In the upper case of the Child Mother "ZZ ". Save and exit.
After the environment variable is configured, you can try the following.
Run the Java-version command. The JDK version and related information are displayed, proving that JDK is OK.
Switch CD to the/opt/tomcat/bin directory and run the command./startup. Sh. The following message is displayed:
Using catalina_base:/opt/tomcat
Using catalina_home:/opt/tomcat
Using catalina_tmpdir:/opt/tomcat/temp
Using jre_home:/usr/Java/jre1.5.0 _ 05
Verify that the installation is successful. If the preceding strategy fails, check the environment variable configuration carefully.
By now, JDK and tomcat have been successfully configured. It is time to configure eclipse.

 

Part 4: Configure eclipse3.2

Remember the Eclipse plug-ins tomcatpluginv32 and cdt3.1 we just downloaded? Now it's time to get them done.

    • Switch CD to the/home/user/| downloads directory. Run the unzip tomcatpluginv32beta.zip command to decompress it and the com. sysdeo. eclipse. tomcat_3.2.0.beta file, run the command cp com. sysdeo. eclipse. tomcat_3.2.0.beta // opt/Eclipse/plugins/copy it to the/opt/Eclipse/plugins/directory.
    • Switch CD to the/home/user/| downloads directory. Run the command tar xvf org.eclipse.cdt-3.1.1-linux.x86.tar.gz to display the eclipse file.
    • CD To Go To The Eclipse/Features/folder. Run the command CP org. Eclipse. cdt_3.1.1.200609270800 // opt/Eclipse/Features/to copy it to the/opt/Eclipse/features directory.
    • CD to go to The Eclipse/Plugins directory. Run the command Cp */opt/Eclipse/plugins/to copy all the files to the/opt/Eclipse/plugins/directory.

OK. Now eclipse is configured. Start eclipse and configure it. After configuration, Java, C, and C ++ can be developed.

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.