Solved

Eclipse 3.0.0 initial setup, Win2K

Posted on 2004-08-16
11
249 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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 if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

867 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