Ant build fails to find referenced libraries - buildpath problem? [message #549446] |
Mon, 26 July 2010 12:14  |
Eclipse User |
|
|
|
Hi all
This is my first post in this forum so forgive me if I have this in the wrong area.
I am trying to build a project with an Ant buildfile and it keeps telling me it can't find the libraries I'm using.
It is just an OSGi tutorial that I'm messing around with trying to learn this thing and it recommended Eclipse.
I have the libraries in the buildpath (the needed class files occur under the library directory thing in the directory tree in the left panel: "Referenced Libraries --> framework.jar --> org.osgi.framework"
One class imports org.osgi.framework.BundleActivator and org.osgi.framework.BundleContext.
Eclipse doesn't seem to have a problem with it and finds them just fine (no errors in the left margin of the editor panel or anything). However the minute I try to use my Ant buildfile to build the project I get a javac error telling me the package "org.osgi.framework" doesn't exist.
The buildfile is in the highest level of the file hierarchy (right below the Java project itself)
Why is it that Eclipse can see the libraries but that Ant buildfile can't?
I'm sure it must be something I'm doing wrong.
[Updated on: Mon, 26 July 2010 12:17] by Moderator
|
|
|
Re: Ant build fails to find referenced libraries - buildpath problem? [message #549453 is a reply to message #549446] |
Mon, 26 July 2010 12:51   |
Eclipse User |
|
|
|
On 7/26/2010 10:14 AM, porchrat wrote:
> Hi all
>
> This is my first post in this forum so forgive me if I have this in the
> wrong area.
>
> I am trying to build a project with an Ant buildfile and it keeps
> telling me it can't find the libraries I'm using.
>
> It is just an OSGi tutorial that I'm messing around with trying to learn
> this thing and it recommended Eclipse.
>
> I have the libraries in the buildpath (they occur under a library thing
> in the directory tree in the left panel under "Referenced Libraries -->
> framework.jar --> org.osgi.framework"
>
> One class imports org.osgi.framework.BundleActivator and
> org.osgi.framework.BundleContext.
>
> Eclipse doesn't seem to have a problem with it and finds them just fine
> (no errors in the left margin of the editor panel or anything). However
> the minute I try to use my Ant buildfile to build the project I get a
> javac error telling me the package "org.osgi.framework" doesn't exist.
>
> The buildfile is in the highest level of the file hierarchy (right below
> the Java project itself)
>
> Why is it that Eclipse can see the libraries but that Ant buildfile can't?
>
> I'm sure it must be something I'm doing wrong.
Note that ant is enabled by Eclipse in that it provides a way for you to
write, maintain and use ant scripts. However, Eclipse does pretty much
nothing else for you that way.
When you write an ant script and run it, from the script's point of
view, Eclipse doesn't exist. So, if you're assuming Eclipse is telling
any anything about where source code and libraries are, you're going to
be disappointed.
If you are used to writing ant scripts devoid of Eclipse, this won't be
a problem as it's business as usual. If, as I did, you start writing ant
from an Eclipse point of view, the learning curve is steeper and rockier.
|
|
|
Re: Ant build fails to find referenced libraries - buildpath problem? [message #549456 is a reply to message #549446] |
Mon, 26 July 2010 12:52   |
Eclipse User |
|
|
|
On 7/26/2010 10:14 AM, porchrat wrote:
> Hi all
>
> This is my first post in this forum so forgive me if I have this in the
> wrong area.
>
> I am trying to build a project with an Ant buildfile and it keeps
> telling me it can't find the libraries I'm using.
>
> It is just an OSGi tutorial that I'm messing around with trying to learn
> this thing and it recommended Eclipse.
>
> I have the libraries in the buildpath (they occur under a library thing
> in the directory tree in the left panel under "Referenced Libraries -->
> framework.jar --> org.osgi.framework"
>
> One class imports org.osgi.framework.BundleActivator and
> org.osgi.framework.BundleContext.
>
> Eclipse doesn't seem to have a problem with it and finds them just fine
> (no errors in the left margin of the editor panel or anything). However
> the minute I try to use my Ant buildfile to build the project I get a
> javac error telling me the package "org.osgi.framework" doesn't exist.
>
> The buildfile is in the highest level of the file hierarchy (right below
> the Java project itself)
>
> Why is it that Eclipse can see the libraries but that Ant buildfile can't?
>
> I'm sure it must be something I'm doing wrong.
Note that ant is enabled by Eclipse in that it provides a way for you to
write, maintain and use ant scripts. However, Eclipse does pretty much
nothing else for you that way.
When you write an ant script and run it, from the script's point of
view, Eclipse doesn't exist. So, if you're assuming Eclipse is telling
ant anything about where source code and libraries are, you're going to
be disappointed.
If you are used to writing ant scripts devoid of Eclipse, this won't be
a problem as it's business as usual. If, as I did, you start writing ant
from an Eclipse point of view, the learning curve is steeper and rockier.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09707 seconds