How to install deployment release Tomcat on Eclipse under Ubuntu

Source: Internet
Author: User

After a half-day finally fix, write down the experience. Really feel the general developers use Windows under development is enough, so-called Ubuntu security is the server, the general developers can not touch, but there are many enthusiasts want to get, I am one of them.

Introduction to my environment: ubuntu14.04 jdk1.7.0_79 tomcat7.0.69 eclipse3.4:j2ee Edition

Here is the beginning: (may be a bit verbose, I am here to detail, will see it)

First eclipse must be installed first, not installed please see below, it is important to note: If you do not understand the installation, then you need to fully follow his ideas to install the JDK and eclipse. With Eclipse and JDK in place, start the Tomcat installation,

I do not use his method here, too complex to understand there are wood there! In fact, installing Tomcat is simple:

The first step: go to the official website directly download, I download TOMCAT7 here (I heard that tomcat8 not too stable, did not try), select the second file download (tar.gz);


The second step: because the default download path in the home folder, so we can directly drag it to the desktop, we began to extract (TAR-ZXVF apache-tomcat-7.0.69.tar.gz), so that the file is available to unzip the desktop;

The third step: Copy the desktop extract files to a directory, such as my words copied to the/opt directory,


Fourth step: Enter/opt/apache-tomcat-7.0. Directory, then execute: Vim./bin/ startup.sh, add path: Like my: (Note if the JDK path you installed here is different from mine, just modify it to your JDK path, and the other JRE is not required).


Fifth step: Execute:./bin/startup.sh, then open the browser input address can get: This is the installation is finished, but the show is still behind, it took less than half an hour, the back spent a long time.


Sixth step: OK after the first to turn off Tomcat, or open eclipse may not open, under the/opt/apache-tomcat-7.0.69 command:./bin/shutdown.sh.

Sixth step: Add Tomcat to eclipse: in fact it's a bit like under Windows, open eclipse-> Select the Window-> Select Preferences in the menu bar above and then choose:


Note that if you choose TOMCAT7, the Next button here is gray, do not choose Tomcat6 or TOMCAT8 (I was like this before, installed three kinds of tomcat). When the gray Next button appears, close Eclipse, and then delete the Eclipse's workspace work area (note: If there are important items to back up first, delete the working range may be gone). Then turn on Eclipse to re-select and click Next.

Then Next:

A bit more finish:


Seventh step: We appear as the server flag: And then start running, if there are any permissions and other errors, directly to the file is not restricted by permission, such as using chmod 777 filename to modify its permissions.

Eighth step: If the seventh step does not appear wrong, then want to run the Web project is not enough, you need to set up here, the settings (do not choose the wrong!). ): (Note: If it is a gray option, please turn Tomcat on or remove the item from Tomcat)


Nineth Step: You can start deploying the Web. First, we're going to create a Dynamic Web project (if you don't know how to create it, you have to search for it yourself, under Windows and under Ubuntu.) I can not, Ubuntu cumbersome) and then we get the default Web project, here we also need to create a JSP file, so that in the browser to test the success. : (JSP placed under the web-content, do not build the wrong location, I was built in the Web-inf directory)


Tenth step: Click on the Web project you just created, select Run on server and then select Tomcat7, then add just the project to Tomcat, then finish will start up, Then add the JSP path in your own browser (after running Tomcat here, eclipse may automatically jump out of the browser page and then error 404, because the path you want to open is not right, you need to add the JSP path in the back, and you don't know where to look at my running path. ), if there is no accident, you can output the JSP content.


Let me tell you the possible mistakes I have encountered:

1, if an error occurs if a certain permission is not enough then please set permissions for these insufficient files, you can use the command chmod 777 filename

(PS: General operation is not a permission problem!!) )

2, if you select Deploy path in the Tomcat view for WebApps error or if there are other questions about WebApps, then modify the WebApps permissions in the Tomcat directory 777 or 750, if not, The folder permissions in the WebApp directory are completely modified.

3, if the port error, please close Tomcat (./bin/shutdown.sh), or use kill-9 port

4, if there is failt to start component, then redeploy TOMCAT7, that is, click on the project to re-deploy the project to tomcat boot.


In fact, the most important thing is: the main issue of installation deployment is the permissions issue!!! Hey, this problem is killing me, I feel the installation process is using chmod 777.

How to install deployment release Tomcat on Eclipse under Ubuntu

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.