Solved

Eclipse 3.0.0 initial setup, Win2K

Posted on 2004-08-16
11
256 Views
Last Modified: 2012-08-13
Hi,
I am trying to set up Eclipse to write a simple java file.  The end use is with the displaytag taglib (JSP) though I don't think that should matter...  I have been playing with Java for a while but haven't been able to spend enough time to get very far up the learning curve and I have also been focused on JSP.

I start with the blank package explorer, right click and select new project, java project.  The java file I need to write needs to import a couple of provided java files:

import org.displaytag.decorator.ColumnDecorator;
import org.displaytag.exception.DecoratorException;

It appears I have to bring those into the project folder in the package explorer in order for eclipse to find the files for the import (puts them in the classpath?).  I found two ways to do this, drag the top level org folder into the folder - this created the need to bring in a bunch of other packages to handle all the dependencies in the 20 or so files in this path, which seems like a bad idea.  The second way was to right click and then import a file - first I had to move the org folder to the root directory so the imports would resolve properly which was a bit tedious.  Is this the best way to add the files to the classpath?

Second problem holding me up is that eventually one of the files has:
import javax.servlet.jsp.JspTagException;
where do I get javax.servelet…?  I recognize it as a Sun package but I couldn’t find it on my computer (Java 1.4.2_04).

To summarize, I have two questions:
1. Best way to add files to the classpath (if I have the terminology right) in a project
2. Where do I get javax.servelet…

Thanks,
Eric
0
Comment
Question by:EricE
  • 6
  • 4
11 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 11817939
I do not know anything about Eclipse so I can't help you with your first question.

The javax.servlet.jsp package is a package that comes with the servlet api 2.2 specification. You should already have it if you have the jdk1.4.2.
0
 

Author Comment

by:EricE
ID: 11817985
Hi,
I did a find across all my hard disks and only came back with some html files that referenced it and a jar file in an eclipse plugin.  No .java file though...

Thanks,
Eric
0
 
LVL 35

Accepted Solution

by:
girionis earned 200 total points
ID: 11818022
They should be in a .jar file, as far as I remember they are now in the j2ee.jar if you download the j2ee sdk or in the servlet.jar if you have the standard sdk.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 9

Expert Comment

by:ronan_40060
ID: 11818883
check out the online documentation of Java on www.eclipse.org 

you can download the Java Development Guide in PDF format everything is mentioned there
0
 

Author Comment

by:EricE
ID: 11827150
Hi,
girionis - I found the servlet.jar file but it doesn't appear to be recognized when I add it to the package explorer...seems like it should work, looks like I will have to RTFM.

ronan - I downloaded the manual when I got eclipse but I was hoping by give the questions what seemed like a relatively large number of points to get somebody to give me the step by step procedure.  I will eventually read the manual, but right now I am working on this stuff too late at night to have the bandwidth to do it now (unless I don't get the answer here of course).

Thanks,
Eric
0
 
LVL 35

Expert Comment

by:girionis
ID: 11827887
What do you mean it does not recognize the package? Are you still getting the same error message?
0
 

Author Comment

by:EricE
ID: 11832017
Hi,
It still gives an error (red underline) under the import statement for import javax.servlet.jsp.JspTagException;.  I am at work now so I don't have the exact error message.  For other import statements, Eclipse would update automatically when I added the org.apache... source to the project and clear errors for the related import statements.  That is not happening when I add the jar file.

Thanks,
Eric
0
 
LVL 35

Expert Comment

by:girionis
ID: 11833019
What happens if you do:

jar -tfv servlet.jar | grep JspTagException
0
 
LVL 35

Expert Comment

by:girionis
ID: 11833024
It might not be in the servlet.jar...
0
 

Author Comment

by:EricE
ID: 11838130
Hi,
It was in the servlet.jar but once I figured out how to import the jar files, Eclipse appears to be smart enough to realize that I don't need it, or at least it generated a class file that worked with displaytag which is all I am looking for at this point.

Thanks,
Eric
0
 
LVL 35

Expert Comment

by:girionis
ID: 11838548
Ah... nice one, thank you for the update (and for accepting an answer) :)

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse formatting 6 87
servlet  URL Rewriting 1 36
web services creation SOAP vs REST 5 38
Chrome and Firefox Java 5 27
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question