Solved

Eclipse 3.0.0 initial setup, Win2K

Posted on 2004-08-16
11
275 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.

688 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