Connecting Tech Pros Worldwide Help | Site Map

Eclipse Error: "org.apache cannot be resolved"

Member
 
Join Date: Sep 2007
Posts: 52
#1: Sep 12 '09
Hi guys,

I am doing JSP stuff in eclipse and when I open my file, i get a red cross on the line:

Expand|Select|Wrap|Line Numbers
  1. <%@page import="org.apache.xml.serialize.*"%>
  2.  
When i move my mouse over it says:

Multiple annotations found at this line:
- The import org.apache cannot be
resolved
- The import org.apache cannot be
resolved


It seem it cant find the classes needed.

Also if i scroll down my code, eclipse give red underline on all classes coming in from that org.apache.xml.serialise like "OutputFormat" and "XmlSerializer" etc.Its a big code which is why I didn't paste it but code is fine, its with import statement and eclipse being unable to link with the needed libraries.


I downloaded Xerces, extracted the Jar files and put them in my WEB-INF directory so the classes needed are in /WEB-INF/org/apache/xml/Serialise

That didnt work. Any suggestions anyone? Thanks heaps for looking at it. I attached screenshot of my Eclipse below
Attached Thumbnails
error.bmp   error2.bmp  
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Sep 12 '09

re: Eclipse Error: "org.apache cannot be resolved"


Don't extract the class files. Just add the jar file to your class path.
You should also not be writing Java code inside JSPs anyway.
Reply