package does not exist [message #76154] |
Thu, 09 June 2005 11:46  |
Eclipse User |
|
|
|
I am struggling with this issue:
I modified a JSP file and inserted several import statements (per the
example). All the import statements worked except one
(org.apache.commons.fileupload). I received the following error message:
C:\Program Files\Apache Software Foundation\Tomcat
5.0\work\Catalina\localhost\BAF_CustomWebServiceClientMod\or g\apache\jsp\sampleBAF_005fBOMLibraryMethodsSoapProxy\Result _jsp.java:6:
package org.apache.commons.fileupload does not exist
import org.apache.commons.fileupload.*;
^
1 error
I did the following to resolve:
1) I downloaded the commons fileupload 1.0 from Apache.
2) I updated my classpath variable within control
panel->system->advanced->environment variables to contain a pointer to the
new directory and another pointer to the .jar file.
3) I right clicked on my project, within the work space, selected Java
Build Path->Libraries->Add External JARs, and added the
commons-fileupload-1.0.jar
4) At the same popup, I then selected the Order and Export tab. From
there I selected the commons-fileupload-1.0.jar.
After doing all of this, I still received the same error.
I would appreciate any help that I can get.
|
|
|
Re: package does not exist [message #76602 is a reply to message #76154] |
Fri, 10 June 2005 10:57  |
Eclipse User |
|
|
|
Originally posted by: eclipse.rizzoweb.com
Ben wrote:
> I am struggling with this issue:
>
> I modified a JSP file and inserted several import statements (per the
> example). All the import statements worked except one
> (org.apache.commons.fileupload). I received the following error message:
>
> C:\Program Files\Apache Software Foundation\Tomcat
> 5.0\work\Catalina\localhost\BAF_CustomWebServiceClientMod\or g\apache\jsp\sampleBAF_005fBOMLibraryMethodsSoapProxy\Result _jsp.java:6:
> package org.apache.commons.fileupload does not exist
> import org.apache.commons.fileupload.*;
> ^
> 1 error
>
> I did the following to resolve:
> 1) I downloaded the commons fileupload 1.0 from Apache. 2) I updated my
> classpath variable within control panel->system->advanced->environment
> variables to contain a pointer to the new directory and another pointer
> to the .jar file.
> 3) I right clicked on my project, within the work space, selected Java
> Build Path->Libraries->Add External JARs, and added the
> commons-fileupload-1.0.jar
> 4) At the same popup, I then selected the Order and Export tab. From
> there I selected the commons-fileupload-1.0.jar.
>
> After doing all of this, I still received the same error.
> I would appreciate any help that I can get.
>
I have several things to say:
1) It is not necessary to maintain a system CLASSPATH in control panel
settings for windows. Eclipse does not use it, and it will actually
cause you headaches eventually to have a global classpath setting. Best
to use a script or shortcut for configuring and launching Java
applications, including Eclipse.
2) You probably want to copy the JAR into a lib directory in your
project, rather than refer to it as an external JAR. In your Project
properties build path you can refer to it locally, and then also in your
application launch configuration (more on that in a minute).
3) You probably do not need to include the JAR in the Order and Export
tab - unless there are other Projects that depend on this one.
4) Even though you have added the JAR to the build path, that does not
necessarily mean it is being included on the runtime classpath. That is
why you are getting the error at runtime.
How are you launching your application (Tomcat)? You must edit the
launch configuration to include the new JAR on its classpath. If you do
not know what I'm talking about here, my first suggestion is to go
through the Java Development (JDT) tutorial that is included with
Eclipse. It will familiarize you with a lot of concepts and features
that will hopefully make this make more sense.
If, after going through the tutorial(s) you still have questions, feel
free to post again.
HTH,
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.09568 seconds