Eclipse
IDE for J2EE 1.3 Development
|
|
by Hao Wu extended with permission by Tyler Strickland (tylerATtylersDOTorg) |
|
Last modified: 05/16/2003 |
Purpose
This article covers setting up the following
Open Source tools for J2EE 1.3 development.
- Jakarta Tomcat
4.1.x
- Eclipse Java IDE
* These instructions assume a Windows platform. Linux needs
slightly different URLs & similar steps.
* Following the order
herein is recommended.
Quick Reference
|
Software |
Current Version |
Vendor |
Description |
Installation |
|
1.4.1_02 |
J2SE 1.4 |
Install |
||
|
(Open Source) |
4.1.24 |
J2EE
1.3 |
Unzip |
|
|
(Open Source) |
2.1 |
Java IDE |
Unzip |
|
|
0.96 |
(France) |
IDE Plugin |
Unzip |
|
Version |
1.4.0 |
|
Download |
Get binary j2sdk-1_4_1_02-windows-i586.exe
at http://java.sun.com/j2se/1.4.1/download.html |
|
Documentation |
- Online –
http://java.sun.com/j2se/1.4.1/docs/index.html |
|
Install |
Run the executable which will install the following:
|
|
Environment |
Set variable JAVA_HOME to <install dir> (e.g. C:\j2sdk1.4.1_02). Make sure <install dir>\bin is in your PATH (e.g. C:\j2sdk1.4.1_02\bin). |
|
Test |
Open a DOS window (Start -> Run... -> cmd), try java -version and you should get: java version "1.4.1_02" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06) Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode) |
|
Version |
04/01/24 |
|
Download |
Get zip binary at
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.24/bin/jakarta-tomcat-4.1.24-LE-jdk14.zip |
|
Documentation |
- Online -
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/index.html |
|
Install |
Unzip to destination (say C:\, which makes <install dir> to be C:\jakarta-tomcat-4.1.24-LE-jdk14). |
|
Environment |
Set variable TOMCAT_HOME to <install dir> (e.g. C:\jakarta-tomcat-4.1.24-LE-jdk14). |
|
Test |
"cd %TOMCAT_HOME%\bin" and "startup" (startup.bat), you should see --- Apr 9, 2003 1:47:27 PM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Apr 9, 2003 1:47:27 PM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Apr 9, 2003 1:47:28 PM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Apr 9, 2003 1:47:29 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.24-LE-jdk14 Apr 9, 2003 1:47:34 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8080 Apr 9, 2003 1:47:34 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Apr 9, 2003 1:47:34 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/40 config=C:\jakarta-tomcat-4.1.24-LE-jdk14\bin\.. \conf\jk2.properties Now that Tomcat is up, access http://localhost:8080 from your browser. You can stop the server by selecting its console window and typing Ctrl-C |
|
Other |
o Installing Sysdeo Eclipse Tomcat Launcher Plugin (refer to the later section) |
|
Version |
2.1 |
|
Download |
Get zip binary at
ftp://download.eclipse.org/R-2.1-200303272130/eclipse-SDK-2.1-win32.zip |
|
Documentation |
- Eclipse FAQ:
http://www.eclipse.org/eclipse/faq/eclipse-faq.html |
|
Upgrade from Previous Version |
- Rename your previous installation (say C:\eclipse to
C:\eclipse_old). And remove it after you get the new version up
for a while. |
|
Install |
Unzip to destination (say C:\, which makes <install dir> to be C:\eclipse). Create a shortcut on your Start Menu or Quick Launch to c:\eclipse\eclipse.exe |
|
Test |
- You should have a JDK installed (if you use Sun JDK, 1.4.0 is
recommended for hot code replacement support). |
|
Other |
Tomcat Plugin for Eclipse (see below) |
|
Version |
V21 |
|
Download |
Get binary tomcatPluginV21.zip
at
http://www.sysdeo.com/eclipse/tomcatPluginV21.zip |
|
Documentation |
Online instructions: http://www.sysdeo.com/eclipse/tomcatPlugin.html |
|
Upgrade from Previous Version |
- If you did NOT just install a new version of Eclipse, remove the old plugin directory (for example, C:\eclipse\plugins\com.sysdeo.eclipse.tomcat\)
|
|
Install |
Unzip to <Eclipse install dir>\plugins\ (the plugin will reside under <Eclipse install dir>\plugins\com.sysdeo.eclipse.tomcat). |
|
Configure Eclipse |
Note:
<classpathentry kind="var"
path="TOMCAT_HOME/lib/jasper-runtime.jar"/> |
|
Version |
4.1.24 (Corresponds to the Tomcat version installed) |
|
Download |
Get zip binary at:
http://www.sysdeo.com/eclipse/jasperDebugPatchV4.1.24.zip |
|
Documentation |
Online instructions: http://www.sysdeo.com/eclipse/tomcatPlugin.html |
|
Install |
To install this patch, unzip the file in
<%TOMCAT_HOME%>/common/classes for Tomcat 4.1.x (See the
above site for earlier versions of Tomcat) |
Creating your project:
Create a new Tomcat Project:
File -> New -> Project -> Java (on left) -> Tomcat Project (on right). Click Next. Name the project. Click Finish.
Make sure Tomcat menu is accessible.
Select the Java Perspective (the icon on the left with the J in it) and add the Tomcat buttons to it:
Window -> Customize Perspective. Other -> check the Tomcat option
Use menu or toolbar to Start/Stop Tomcat (The plugin will start/stop Tomcat as a debugging mode VM inside Eclipse, so debugging into Servlets and JSP-generated-Servlets becomes possible.)
Unzip the project source into the directory of the new project, c:\eclipse\workspace\<project name> for example.
Right click on the project name in the left window of Eclipse and select Refresh. The project will compile with errors. Don't worry about them.
Right click on the project name in the left window of Eclipse and select Properties.
Click on Java Build Path. Under the Source tab, click Add Folder. Select the <project name>/src folder. Click OK.
It will ask you: Do you want to remove the project as source folder and update build output folder to <project name>/bin? Click Yes
Click on the Libraries tab. This is where you will add any required libraries, such as idb.jar (for InstantDB) using the Add External Jars button.
Click on the Tomcat menu on the left.
Check the Is this a Tomcat project checkbox.
Check the Redirect context logger to Eclipse console checkbox.
Set the Subdirectory to set as web application root to /webroot/
Click OK, then OK again when it asks you about the new output folder.
Right click on the project name. Choose Tomcat project -> Add Tomcat libraries to project build path
Add the context: Right click on the project name. Choose Tomcat project ->Update context in server.xml
Remove it: Right click on the project name. Choose Tomcat project ->Remove context in server.xml
Add it again: (We do this to bypass a bug in the default Tomcat setup)
Right click on the project name. Choose Tomcat project ->Update context in server.xml
Go to Window -> Preferences; Tomcat menu. Add your project to the Tomcat classpath.
19.We also need to remove the comments around the default invoker from the file <TOMCAT_ROOT>\conf\web.xml
1. Open the file in a text editor like notepad (NOT Word) and look for a section like the following:
<!-- The mapping for the invoker servlet -->
<!--
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
-->
2. Remove the comments around the servlet mapping section (the <!-- and --> that are on their own lines).
20.You will still have a few warnings in the project, but don't worry about those, they will go away as you work on the project.
21. Look around the Window -> Preferences menu and customize the IDE to your delight. It has many valuable features that will make your life much easier.
|
Original Copyright © 2002 Purpose Solutions,
Inc. Modified and distributed with permission |