{"id":5,"date":"2009-01-18T16:10:07","date_gmt":"2009-01-18T23:10:07","guid":{"rendered":"http:\/\/www.zulutown.com\/blog\/?p=5"},"modified":"2009-01-21T11:46:28","modified_gmt":"2009-01-21T18:46:28","slug":"setup-tomcat6-on-eclipse","status":"publish","type":"post","link":"https:\/\/www.zulutown.com\/blog\/2009\/01\/18\/setup-tomcat6-on-eclipse\/","title":{"rendered":"Setup Tomcat6 on Eclipse"},"content":{"rendered":"<p>Download Eclipse IDE for Java EE Developers from <a href=\"http:\/\/www.eclipse.org\/downloads\/\">http:\/\/www.eclipse.org\/downloads\/<\/a> and tomcat6 from <a href=\"http:\/\/tomcat.apache.org\/download-60.cgi\">http:\/\/tomcat.apache.org\/download-60.cgi<\/a><\/p>\n<p>Extract both of them where you prefer. I extracted Eclipse in \/opt\/eclipse and Tomcat in \/opt\/tomcat6), then run Eclipse.<\/p>\n<p>When you&#8217;ll run eclipse it asks you about creating a new workspace (that will be used to store all of your projects), so create a <em>workspace<\/em>, usually somewhere in your user home directory.<\/p>\n<p>When Eclipse is up and running, choose <em>preferences<\/em> from the <em>window<\/em> menu. Choose from the bar on the left: Server, Runtime Environments.<\/p>\n<div id=\"attachment_6\" style=\"width: 247px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6\" class=\"size-medium wp-image-6\" title=\"Preferences\" src=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/screenshot-preferences-237x300.png\" alt=\"Preferences window in Eclipse\" width=\"237\" height=\"300\" srcset=\"https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/screenshot-preferences-237x300.png 237w, https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/screenshot-preferences.png 628w\" sizes=\"auto, (max-width: 237px) 100vw, 237px\" \/><p id=\"caption-attachment-6\" class=\"wp-caption-text\">Preferences<\/p><\/div>\n<p>Click the button <em>Add<\/em>, choose <em>Apache Tomcat 6<\/em>.<\/p>\n<div id=\"attachment_7\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7\" class=\"size-medium wp-image-7\" title=\"New Server Runtime Environment\" src=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/screenshot-new-server-runtime-environment-300x275.png\" alt=\"New Server Runtime Environment\" width=\"300\" height=\"275\" srcset=\"https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/screenshot-new-server-runtime-environment-300x275.png 300w, https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/screenshot-new-server-runtime-environment.png 613w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-7\" class=\"wp-caption-text\">New Server Runtime Environment<\/p><\/div>\n<p>In the next page, <em>browse<\/em> on your disk and choose the directory where you previously extracted Tomcat. In my case it&#8217;s \/opt\/tomcat6. Finally click Finish.<\/p>\n<div id=\"attachment_9\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-9\" class=\"size-medium wp-image-9\" title=\"New Server Runtime Environment - Server Path\" src=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/screenshot-new-server-runtime-environment-1-300x275.png\" alt=\"New Server Runtime Environment - Server Path\" width=\"300\" height=\"275\" srcset=\"https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/screenshot-new-server-runtime-environment-1-300x275.png 300w, https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/screenshot-new-server-runtime-environment-1.png 613w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-9\" class=\"wp-caption-text\">New Server Runtime Environment - Server Path<\/p><\/div>\n<p>Well, until now we have just told to our workspace where Tomcat &#8220;installation&#8221; is located on our disk.<\/p>\n<p>But, if we wish to run Java Web Applications within Eclipse, we should setup a Server and eventually assign to it a specific configuration.<br \/>\nGo in the <em>Servers<\/em> view, right click and choose New, then Server.<\/p>\n<p>Select &#8220;Tomcat v6.0 Server&#8221; as server type (or probably it will be automatically pre-selected), then, in the <em>Server Runtime environment<\/em> select box you&#8217;ll have to choose &#8220;Apache Tomcat v6.0&#8221; (that&#8217;s probably the only available option.<\/p>\n<div id=\"attachment_39\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-39\" class=\"size-medium wp-image-39\" title=\"New Tomcat Server in Eclipse\" src=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/eclipse-new-tomcat-server-300x290.png\" alt=\"New Tomcat Server in Eclipse\" width=\"300\" height=\"290\" srcset=\"https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/eclipse-new-tomcat-server-300x290.png 300w, https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/eclipse-new-tomcat-server.png 613w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-39\" class=\"wp-caption-text\">New Tomcat Server in Eclipse<\/p><\/div>\n<p>Click on Next, Eclipse will prompt you to eventually add (or remove) web projects from this Server, in this case, if your workspace is empty you&#8217;ll have not any project to add. So, click <em>Finish<\/em>.<\/p>\n<div id=\"attachment_40\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-40\" class=\"size-medium wp-image-40\" title=\"Add remove Eclipse projects from Tomcat\" src=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/eclipse-add-remove-projects-from-tomcat-300x290.png\" alt=\"eclipse-add-remove-projects-from-tomcat\" width=\"300\" height=\"290\" srcset=\"https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/eclipse-add-remove-projects-from-tomcat-300x290.png 300w, https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/eclipse-add-remove-projects-from-tomcat.png 613w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-40\" class=\"wp-caption-text\">Add remove Eclipse projects from Tomcat<\/p><\/div>\n<p>In the <em>Servers<\/em> panel, you will see the Tomcat you just added, and in the <em>Project Explorer<\/em> view, a new Server configuration will  magical appear.<\/p>\n<p>So you can edit the configuration file <code>server.xml<\/code> as you prefer, change AJP or HTTP connector ports and so on, start\/stop\/debug the server and obviously add and remove projects from it.<\/p>\n<div id=\"attachment_41\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-41\" class=\"size-medium wp-image-41\" title=\"Editing Tomcat configuration in Eclipse\" src=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/tomcat-configuration-300x177.png\" alt=\"Editing Tomcat configuration in Eclipse\" width=\"300\" height=\"177\" srcset=\"https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/tomcat-configuration-300x177.png 300w, https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/tomcat-configuration.png 395w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-41\" class=\"wp-caption-text\">Editing Tomcat configuration in Eclipse<\/p><\/div>\n<p>It is also possible to add other server &#8220;instances&#8221;, just right click again in the &#8220;Servers&#8221; view, and follow the procedure described before.<\/p>\n<p>In this way, you will just a single &#8220;Tomcat&#8221; binaries location (that you defined in the first step of this tutorial), but you&#8217;ll have the chance to add many instances of that server, each of them with its specific configuration (imagine the <code>\/conf<\/code> directory of Tomcat) and its specific web application (imagine the <code>\/webapps<\/code> directory).<\/p>\n<div id=\"attachment_42\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-42\" class=\"size-medium wp-image-42\" title=\"Multiple Tomcat Instances in Eclipse\" src=\"http:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/eclipse-multiple-tomcat-instances-300x291.png\" alt=\"Multiple Tomcat Instances in Eclipse\" width=\"300\" height=\"291\" srcset=\"https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/eclipse-multiple-tomcat-instances-300x291.png 300w, https:\/\/www.zulutown.com\/blog\/wp-content\/uploads\/2009\/01\/eclipse-multiple-tomcat-instances.png 389w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-42\" class=\"wp-caption-text\">Multiple Tomcat Instances in Eclipse<\/p><\/div>\n<p>For the more expert ones, it is similar to have more instances on the same tomcat binaries defined on different <code>CATALINA_BASE<\/code> paths.<\/p>\n<p>I hope this tutorial has been useful, please post any question or comment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Download Eclipse IDE for Java EE Developers from http:\/\/www.eclipse.org\/downloads\/ and tomcat6 from http:\/\/tomcat.apache.org\/download-60.cgi Extract both of them where you prefer. I extracted Eclipse in \/opt\/eclipse and Tomcat in \/opt\/tomcat6), then run Eclipse. When you&#8217;ll run eclipse it asks you about &hellip; <a href=\"https:\/\/www.zulutown.com\/blog\/2009\/01\/18\/setup-tomcat6-on-eclipse\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[7,164,6,165,5],"class_list":["post-5","post","type-post","status-publish","format-standard","hentry","category-eclipse","category-tomcat","tag-configuration","tag-eclipse","tag-ganymede","tag-tomcat","tag-tomcat6"],"_links":{"self":[{"href":"https:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/posts\/5","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":10,"href":"https:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"predecessor-version":[{"id":14,"href":"https:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/posts\/5\/revisions\/14"}],"wp:attachment":[{"href":"https:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zulutown.com\/blog\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}