Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Using an external package/class files
Using an external package/class files [message #146994] Thu, 06 April 2006 18:18 Go to next message
Eclipse UserFriend
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 messageGo to next message
Eclipse UserFriend
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
Eclipse UserFriend
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
Previous Topic:how to set memory size when run app in eclipse
Next Topic:Can I create an eclipse plugin with Swing?
Goto Forum:
  


Current Time: Sun Jun 30 14:25:16 GMT 2024

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

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

Back to the top