Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » cannot resolve
cannot resolve [message #188294] Tue, 16 January 2007 02:36 Go to next message
Eclipse UserFriend
Originally posted by: starkweatherd.cox.net

hello,

I'm having trouble getting my project to recognize some library .jar files
for a java project. I have some jar files in a /lib directory that I put
right in the project directory itself. I set the classpath variables using
PROJECT --> PROPERTIES -> BUILDPATH etc. (I tried adding it a few
different ways but to no avail: a variable, external jar, jar file,
etc. ) Every time i get the following errror message: "the import [package
name] cannot be resolved" . Also, in the package view, the the packages
have a red error marking on the icons. Does anyone know how I can resolve
this?
thanks,
dgs.
Re: cannot resolve [message #188355 is a reply to message #188294] Tue, 16 January 2007 09:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

Do you need to add it as a dependency?
--
Derek


David Starkweather wrote:
> hello,
>
> I'm having trouble getting my project to recognize some library .jar files
> for a java project. I have some jar files in a /lib directory that I put
> right in the project directory itself. I set the classpath variables using
> PROJECT --> PROPERTIES -> BUILDPATH etc. (I tried adding it a few
> different ways but to no avail: a variable, external jar, jar file,
> etc. ) Every time i get the following errror message: "the import [package
> name] cannot be resolved" . Also, in the package view, the the packages
> have a red error marking on the icons. Does anyone know how I can resolve
> this?
> thanks,
> dgs.
>
>
Re: cannot resolve [message #188421 is a reply to message #188355] Tue, 16 January 2007 14:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: starkweatherd.cox.net

I added it to the Project Buildpath. It is a component jar file that my
project needs to use. It is not another project that I created, just an
external component. I'm not aware of anything else I was supposed to do, but
i'll look into adding it as a dependency as well.

thanks,
dgs.


"Derek Morris" <dmsubs@NOSPAM.consertum.com> wrote in message
news:eoi5ep$m91$2@utils.eclipse.org...
> Do you need to add it as a dependency?
> --
> Derek
>
>
> David Starkweather wrote:
>> hello,
>>
>> I'm having trouble getting my project to recognize some library .jar
>> files for a java project. I have some jar files in a /lib directory that
>> I put right in the project directory itself. I set the classpath
>> variables using PROJECT --> PROPERTIES -> BUILDPATH etc. (I tried
>> adding it a few different ways but to no avail: a variable, external
>> jar, jar file, etc. ) Every time i get the following errror message:
>> "the import [package name] cannot be resolved" . Also, in the package
>> view, the the packages have a red error marking on the icons. Does
>> anyone know how I can resolve this?
>> thanks,
>> dgs.
Re: cannot resolve [message #188429 is a reply to message #188421] Tue, 16 January 2007 14:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: starkweatherd.cox.net

ok, i got it now. It turns out that the problem was that the jar file i was
adding on the build path was contained within another jar file. So, i had
to un-jar it first and then add the contained jar file tdo the classpath. I
was adding the larger jar file to the classpath without un-jar'ing it first.
thanks,

dgs.


"David Starkweather" <starkweatherd@cox.net> wrote in message
news:eoimuo$na8$1@utils.eclipse.org...
>I added it to the Project Buildpath. It is a component jar file that my
>project needs to use. It is not another project that I created, just an
>external component. I'm not aware of anything else I was supposed to do,
>but i'll look into adding it as a dependency as well.
>
> thanks,
> dgs.
>
>
> "Derek Morris" <dmsubs@NOSPAM.consertum.com> wrote in message
> news:eoi5ep$m91$2@utils.eclipse.org...
>> Do you need to add it as a dependency?
>> --
>> Derek
>>
>>
>> David Starkweather wrote:
>>> hello,
>>>
>>> I'm having trouble getting my project to recognize some library .jar
>>> files for a java project. I have some jar files in a /lib directory
>>> that I put right in the project directory itself. I set the classpath
>>> variables using PROJECT --> PROPERTIES -> BUILDPATH etc. (I tried
>>> adding it a few different ways but to no avail: a variable, external
>>> jar, jar file, etc. ) Every time i get the following errror message:
>>> "the import [package name] cannot be resolved" . Also, in the package
>>> view, the the packages have a red error marking on the icons. Does
>>> anyone know how I can resolve this?
>>> thanks,
>>> dgs.
>
>
Re: cannot resolve [message #191947 is a reply to message #188294] Sat, 03 February 2007 18:07 Go to previous messageGo to next message
Victor Eijkhout is currently offline Victor EijkhoutFriend
Messages: 7
Registered: July 2009
Junior Member
David Starkweather wrote:
> hello,
>
> I'm having trouble getting my project to recognize some library .jar files
> for a java project.

My problem is similar. I try to compile a source that has "import
com.foo.bar.*" and I have a directory structure com/foo/bar/* somewhere
in my disc. But I can't figure out how to add it.

Project > Properties > Java Build Path > Libraries.

And then?

Victor.
Re: cannot resolve [message #192242 is a reply to message #191947] Tue, 06 February 2007 16:41 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

Victor Eijkhout wrote:
> My problem is similar. I try to compile a source that has "import
> com.foo.bar.*" and I have a directory structure com/foo/bar/* somewhere
> in my disc. But I can't figure out how to add it.
>
> Project > Properties > Java Build Path > Libraries.
>
> And then?

If the directory containing the classes is in a Project in Eclipse, you
can use the "Add class folder..." button to include it.
If the classes are not in an Eclipse project, you have a couple of options:
A) Make a JAR (or ZIP) out of the classes directory structure and add
that to your build path. Most code libraries are shipped as a JAR anyway...

B) Add the classes directory as a Linked Resource to your Project in
Eclipse. (Search the Eclipse Help Contents for "linked resources" to
learn the details.) Then you can use the "Add classes folder..." button
to include that on your build path.

Hope this helps,
Eric
Previous Topic:Problem saving changes to external include paths and libraries in CDT
Next Topic:Can I make money by writing Eclipse plugin?
Goto Forum:
  


Current Time: Thu Apr 18 03:43:16 GMT 2024

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

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

Back to the top