Solved

Eclipse 3.0.0 initial setup, Win2K

Posted on 2004-08-16
11
238 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
 
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now