Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Why am I getting compile errors when library is in the classpath?
Why am I getting compile errors when library is in the classpath? [message #497133] Thu, 12 November 2009 15:20 Go to next message
D. Alvarado is currently offline D. AlvaradoFriend
Messages: 91
Registered: July 2009
Member
Hi,

I'm using Eclipse Galileo for Mac 10.5.6. I have this entry in my ROOT_PROJECT/service/.classpath file ...

<classpathentry sourcepath="MAVEN_REPO/javax.mail/java-sources/mail-1.4-sources.jar " kind="var" path="MAVEN_REPO/javax.mail/jars/mail-1.4.jar"></classpathentry >

However, when I open a .java source file from within the ROOT_PROJECT/service/src/main/java/package/of/file/ directory, Eclipse complains about the import

import javax.mail.MessagingException;

underlining "javax.mail" and saying, "The import javax.mail cannot be resolved". I have verified the classpath entry above contains the class in question. Any ideas how to troubleshoot why it is telling me this? There are other imports it is also complaining about in a similar way.

- Dave
Re: Why am I getting compile errors when library is in the classpath? [message #497201 is a reply to message #497133] Thu, 12 November 2009 19:37 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
D. Alvarado wrote:
> Hi,
>
> I'm using Eclipse Galileo for Mac 10.5.6. I have this entry in my
> ROOT_PROJECT/service/.classpath file ...
>
> <classpathentry
> sourcepath="MAVEN_REPO/javax.mail/java-sources/mail-1.4-sources.jar "
> kind="var"
> path="MAVEN_REPO/javax.mail/jars/mail-1.4.jar"></classpathentry >
>
> However, when I open a .java source file from within the
> ROOT_PROJECT/service/src/main/java/package/of/file/ directory, Eclipse
> complains about the import
>
> import javax.mail.MessagingException;
>
> underlining "javax.mail" and saying, "The import javax.mail cannot be
> resolved". I have verified the classpath entry above contains the class
> in question. Any ideas how to troubleshoot why it is telling me this?
> There are other imports it is also complaining about in a similar way.
>
> - Dave

Is the MAVEN_REPO classpath variable set to what you would expect?
Re: Why am I getting compile errors when library is in the classpath? [message #497904 is a reply to message #497133] Fri, 13 November 2009 14:40 Go to previous messageGo to next message
D. Alvarado is currently offline D. AlvaradoFriend
Messages: 91
Registered: July 2009
Member
Hi, Yes, MAVEN_REPO is set correctly. One thing I didn't include in here is that I have a .classpath file in my root project folder and then there are .classpath files in my sub-projects. I am getting the lingering suspicion that Eclipse cannot "merge" nested .classpath files. Any thoughts on that? - Dave
Re: Why am I getting compile errors when library is in the classpath? [message #498036 is a reply to message #497904] Fri, 13 November 2009 18:16 Go to previous message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
D. Alvarado wrote:
> Hi, Yes, MAVEN_REPO is set correctly. One thing I didn't include in
> here is that I have a .classpath file in my root project folder and then
> there are .classpath files in my sub-projects. I am getting the
> lingering suspicion that Eclipse cannot "merge" nested .classpath
> files. Any thoughts on that? - Dave

Eclipse can't handle nested projects at all. That is one of the (many)
mismatches between Maven and Eclipse. The M2Eclipse plugin attempts, with
varying success, to resolve these. You might want to give it a try.
Previous Topic:Lua DLL
Next Topic:Plugin Manager
Goto Forum:
  


Current Time: Fri Apr 19 04:39:51 GMT 2024

Powered by FUDForum. Page generated in 0.02985 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top