| |||||||||
How to configure Tomcat 5 and Eclipse to run Java 5
How to configure Tomcat 5 and Eclipse to run Java 5The other day I set up a project using Tomcat 5.0 and Eclipse (the EclipseEE edition). While the server ran the dated Tomcat 5, it luckily supported Java 5. Unfortunately, while Tomcat 5.x is capable of running Java 5, it defaults to older versions. Tomcat 5.0 defaults to using Java 1.3, Tomcat 5.5 defaults to Java 1.4. The next hurdle is to configure the server in EclipseEE. This is quite easy.. once you figure out how. Since I spent a few hours pulling all the strings together, I figured I might as well document my findings here so others hopefully saves a bit of time...Configure Tomcat 5.xOlder Tomcat's out of the box will complain with the following error message upon asked to serve a JSP containing Java 5 code.javac
compiler, while you need to configure the jasper JSP compiler. This is fortunately quite easy,
although finding out on the Tomcat site is quite convoluted. All you need to do is to edit your TOMCAT_INSTALL\conf\web.xml. Add to the
org.apache.jasper.servlet.JspServlet the following lines
Configuring EclipseThe EE edition of Eclipse has a nice feature of enabling you to create a Dynamic web project - essentially an exploded war file and manage the server instance for you and set up debugging. Convenient once you know how it works. Basically what the standard setup does, is that it copies the Tomcat configuration files from your install directory onto some obscure path similar toc:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\ The first thing to realize is that it copies the files from
your installed Tomcat directory quite frequently, so editing your web.xml in this directory as instructed above will only work for a short time.
You may also try editing the web.xml under the Servers project Eclipse installs when you setup your first server. I had a very hard time
making Eclipse pick up changes in this file..
Instead, simply delete your server instance and re-create it. Your changes will now have been picked up and you are ready to go!
CommentsIf you have any comments to this article, please drop me a mail at firstclassthoughts at gmail dot com please indicate if I can't publish whole or parts of your comment on the site.If you like this site consider Help spread the wordShare this post on your favorite social bookmarking sites:
The most recent contributions 28/07/09 Magic in mathematics II Fun with the number cyclic numbers, and specifically with 142857 as it is the smallest of such numbers. 13/07/09 My top 8 time-saving Firefox shortcuts This article presents my favorite top 8 time-saving shortcuts in Firefox 3.0 and Firefox 3.5. Get to know these and you'll be saving a lot of time. They have been ordered by "the element of most surprise" 20/05/09 Board Game Jungle speed / Arriba Review of the cool game "Jungle Speed" aka. "Arriba". 16/05/09 Danish Twin words "Twin words" are words that not only have multiple meanings, they must be composed next to each other in meaningful sentences. This article explores the concept of twin words. Nothing of interest? Try browsing the entire article archive... | |||||||||