Using an external package/class files [message #146994] |
Thu, 06 April 2006 18:18 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: steveb.phoenixscripts.co.uk
I'm making a program for a University project and have been provided with
a 'black-box' that performs most of the functions the program will be
dealing with. The format of the black-box is some .class files in a folder
structure, in such a way that the location of the files from my main
directory is .\uk\ac\bath\CM10137. I then import the necessary classes
with
"import uk.ac.bath.CM10137.*;"
But eclipse is failing to recognize the classes in the folders. It will
underline all the classes from the blackbox in red, saying it cannot
resolve to a type, but the errors are not listed in the Problems panel.
The program will then run without issues (sometimes), but I get none of
the benefits of code insight/completion, which is why I used eclipse in
the first place.
What do I need to do to make eclipse understand the files properly?
Thanks,
Steve
|
|
|
Re: Using an external package/class files [message #147053 is a reply to message #146994] |
Thu, 06 April 2006 20:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: wharley.bea.com
"Steve" <steveb@phoenixscripts.co.uk> wrote in message
news:0e261f181247590b937da4421a017a21$1@www.eclipse.org...
> I'm making a program for a University project and have been provided with
> a 'black-box' that performs most of the functions the program will be
> dealing with. The format of the black-box is some .class files in a folder
> structure, in such a way that the location of the files from my main
> directory is .\uk\ac\bath\CM10137. I then import the necessary classes
> with "import uk.ac.bath.CM10137.*;"
> But eclipse is failing to recognize the classes in the folders. It will
> underline all the classes from the blackbox in red, saying it cannot
> resolve to a type, but the errors are not listed in the Problems panel.
> The program will then run without issues (sometimes), but I get none of
> the benefits of code insight/completion, which is why I used eclipse in
> the first place.
>
> What do I need to do to make eclipse understand the files properly?
How are you adding the files to the java build path in Eclipse?
Note, you may need to put them in a subdirectory (e.g., .\lib) of your main
project in order to be able to add that directory as a class folder in the
build path dialog.
There have been some discussions lately on the eclipse.platform newsgroup on
how to include third-party code into a plugin; you might want to poke around
there. Most of those discussions have focused on including jars rather than
raw classes, but the same principles generally apply.
|
|
|
Re: Using an external package/class files [message #147108 is a reply to message #146994] |
Thu, 06 April 2006 22:37 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: eclipse3.rizzoweb.com
Steve wrote:
> I'm making a program for a University project and have been provided
> with a 'black-box' that performs most of the functions the program will
> be dealing with. The format of the black-box is some .class files in a
> folder structure, in such a way that the location of the files from my
> main directory is .\uk\ac\bath\CM10137. I then import the necessary
> classes with "import uk.ac.bath.CM10137.*;"
> But eclipse is failing to recognize the classes in the folders. It will
> underline all the classes from the blackbox in red, saying it cannot
> resolve to a type, but the errors are not listed in the Problems panel.
> The program will then run without issues (sometimes), but I get none of
> the benefits of code insight/completion, which is why I used eclipse in
> the first place.
>
> What do I need to do to make eclipse understand the files properly?
The files need to be added to the build path of your project (Right
click the project and choose Properties, then Add Class Folder... on the
Libraries tab).
Hope this helps,
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.08658 seconds