Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » class file there but Eclipse misses it, errantly says "build path is incomplete.
class file there but Eclipse misses it, errantly says "build path is incomplete. [message #259915] Thu, 03 July 2008 14:14 Go to next message
Eclipse UserFriend
Originally posted by: rtroy.sciencetools.com

Hi All,

I'm having a slower start to using Eclipse than I imagined would be the
case. I'm starting to get the hang of its configuration quirks, but this
one has me completely stumped and very frustrated...

I'm trying to learn how to write GUIs and I've got a complete, working
codebase that was given to me to play with and learn from. It's designed
as a package that calls a particular API and I have the source for both,
though all I really care about is the GUI.

The GUI has about 85 frames (windows), each as its own (sub)class in its
own file, and every one of them calls the API. Yet ONE line in ONE
particular frame is having trouble doing what all the others do. Eclipse
gives two errors:

The project was not built since its build path is incomplete. Cannot find
the class file for <api.package>.<api_class>$<sub_class>. Fix the build...

and

The type <api.package>.<api_class>$<sub_class> cannot be resolved. It is
...

My FIRST reaction was - hey, problem with what I was given! So, I did a
simple one-line javac compile and proved that the results _exactly_ match
what I was given from the people I borrowed the code from, to the byte
(sha1sum is your friend).

Well, when I look in the directory where the API class sits (it's not in a
jar), the supposedly missing class file is staring me in the face. I've
checked that the file is not corrupted, that its permissions are not
broken, etc; there's NOTHING wrong with the class file. I tried removing
the file and testing the by-hand compile and it complains appropriately
that the class file is missing.

I've worked on this for many hours now, reconfiguring, restarting eclipse,
checking import statements, looking for other examples, trying to touch
other methods from other classes in the API, etc. Nothing has borne any
fruit. All the other classes work fine - VERY frustrating. Any change in
the build path yield THOUSANDS of errors, so clearly the error message is
just wrong.

I was thinking that it must be some kind of file-access error, but that
hasn't panned out either. I left the files intact and renamed the
directory - keeping any bad blocks trapped in the existing file(s), and
recreated it. Same error. I rebuilt the API from source, on the box in
question - to prove it wasn't a version issue, and again, it didn't affect
the problem. And, of course you know it, the application runs like a top
when compiled all from source with command-line javac, including the
supposedly problematic frame (class).

Yeah, I could ditch the package and learn on something else, but this code
does things I want to learn how to do, and I'm told by people who know
about this sort of thing that this one is "done the right way." And, I'm
not one to walk away from a challenge - whatever's wrong might be
something I'll encounter again someday...

Thanks for any and all help.

Richard
Re: class file there but Eclipse misses it, errantly says "build path is incomplete. [message #259934 is a reply to message #259915] Thu, 03 July 2008 15:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Richard wrote:
>
> The GUI has about 85 frames (windows), each as its own (sub)class in its
> own file, and every one of them calls the API. Yet ONE line in ONE
> particular frame is having trouble doing what all the others do. Eclipse
> gives two errors:
>
> The project was not built since its build path is incomplete. Cannot
> find the class file for <api.package>.<api_class>$<sub_class>. Fix the
> build...
>
> and
>
> The type <api.package>.<api_class>$<sub_class> cannot be resolved. It is ..
>
> My FIRST reaction was - hey, problem with what I was given! So, I did a
> simple one-line javac compile and proved that the results _exactly_
> match what I was given from the people I borrowed the code from, to the
> byte (sha1sum is your friend).
>
> Well, when I look in the directory where the API class sits (it's not in
> a jar), the supposedly missing class file is staring me in the face.

Have you imported everything into a single Eclipse project, or multiple
projects?
Is the directory that contains the .class files included in the
project's Build Path? And are the .class files in a proper directory
structure that matches their packages?

Without an exact picture of how the project is laid out it is hard to do
more than guess at this point.

Eric
Re: class file there but Eclipse misses it, errantly says "build path is incomplete. [message #259965 is a reply to message #259934] Thu, 03 July 2008 18:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rtroy.sciencetools.com

Eric Rizzo wrote:

> Richard wrote:
>>
>> The GUI has about 85 frames (windows), each as its own (sub)class in its
>> own file, and every one of them calls the API. Yet ONE line in ONE
>> particular frame is having trouble doing what all the others do. Eclipse
>> gives two errors:
>>
>> The project was not built since its build path is incomplete. Cannot
>> find the class file for <api.package>.<api_class>$<sub_class>. Fix the
>> build...
>>
>> and
>>
>> The type <api.package>.<api_class>$<sub_class> cannot be resolved. It is ..
>>
>> My FIRST reaction was - hey, problem with what I was given! So, I did a
>> simple one-line javac compile and proved that the results _exactly_
>> match what I was given from the people I borrowed the code from, to the
>> byte (sha1sum is your friend).
>>
>> Well, when I look in the directory where the API class sits (it's not in
>> a jar), the supposedly missing class file is staring me in the face.

> Have you imported everything into a single Eclipse project, or multiple
> projects?
> Is the directory that contains the .class files included in the
> project's Build Path? And are the .class files in a proper directory
> structure that matches their packages?
>
> Without an exact picture of how the project is laid out it is hard to do
> more than guess at this point.
>
> Eric

Hi Eric,

I imported only the GUI, as a single project. I left the API as a library
to call. It's configured in using Project -> Properties -> Java Build Path
-> Libraries -> Add External Class Folder. Then, I moved it to the top
under Order and Export (I take it that the check-box means to include
during export).

The directory that contains the API's class files is included implicitly,
but not explicitly: It's part of a "package", and there's a directory tree
that reflects that hierarchy - the configured dir is the parent of the
hierarchy.

Note that there really isn't any other configuration that even begins to
work - except perhaps to use a .jar file instead of files and dirs for the
API.

Anything else? -smile-

Thanks for the help,
Richard
Re: class file there but Eclipse misses it, errantly says "build path is incomplete. [message #260217 is a reply to message #259965] Mon, 07 July 2008 14:01 Go to previous message
Eclipse UserFriend
Originally posted by: 4cs6fcg02.sneakemail.com

Richard schreef:
> Eric Rizzo wrote:
>
>> Richard wrote:
>>>
>>> The GUI has about 85 frames (windows), each as its own (sub)class in
>>> its own file, and every one of them calls the API. Yet ONE line in
>>> ONE particular frame is having trouble doing what all the others do.
>>> Eclipse gives two errors:
>>>
>>> The project was not built since its build path is incomplete. Cannot
>>> find the class file for <api.package>.<api_class>$<sub_class>. Fix
>>> the build...
>>>
>>> and
>>>
>>> The type <api.package>.<api_class>$<sub_class> cannot be resolved. It
>>> is ..
>>>
>>> My FIRST reaction was - hey, problem with what I was given! So, I did
>>> a simple one-line javac compile and proved that the results _exactly_
>>> match what I was given from the people I borrowed the code from, to
>>> the byte (sha1sum is your friend).
>>>
>>> Well, when I look in the directory where the API class sits (it's not
>>> in a jar), the supposedly missing class file is staring me in the face.
>
>> Have you imported everything into a single Eclipse project, or
>> multiple projects?
>> Is the directory that contains the .class files included in the
>> project's Build Path? And are the .class files in a proper directory
>> structure that matches their packages?
>>
>> Without an exact picture of how the project is laid out it is hard to
>> do more than guess at this point.
>>
>> Eric
>
> Hi Eric,
>
> I imported only the GUI, as a single project. I left the API as a
> library to call. It's configured in using Project -> Properties -> Java
> Build Path -> Libraries -> Add External Class Folder. Then, I moved it
> to the top under Order and Export (I take it that the check-box means to
> include during export).
>
> The directory that contains the API's class files is included
> implicitly, but not explicitly: It's part of a "package", and there's a
> directory tree that reflects that hierarchy - the configured dir is the
> parent of the hierarchy.

This smells funny.
Suppose the project is ‘GUI test’ and is set up to have source files in
src/ and class files in bin/.
If your class is in package com.my.company.GUI it has to be in directory
src/com/my/company/GUI.

This means that when you’re importing, you do NOT choose the directory
GUI as source, but rather the directory that contains com/, and check com.

Example: you have received a zip with the code, and unzip it in
GUI-to-test. The code has a proper Java directory structure, so you
will have
GUI-to-test/com/my/company/package-doing-computation
GUI-to-test/com/my/company/utility-package
GUI-to-test/com/my/company/GUI

You have two options: either you create an empty project and import
everything it, or you create a project based on existing files.

The latter goes like this:
File → New → Project → Java Project → Create project from existing
source. Here you browse to directory GUI-to-test. The wizard will
automatically choose all code, so you’ll want to remove the non-GUI code
from the build path. It will, however, import these directories in the
project, so you might not want that. So on to the second option:

Create an empty project with New → Project → Java project.
File → Import… → General → File System → From Directory should be
GUI-to-test, you unfold com/my/company and check the box at GUI, but not
at the other ones. The destination should be your new project (or
rather, its source folder). Unfortunately, this will copy the all
files. You can also directly import from an archive file (the ZIP).

If this doesn’t fit you, describe *exactly* what you did and what you want.

HTH, H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Previous Topic:debugging a C++ executable w/ command line parameters
Next Topic:how to exclude a directory from auto-refresh
Goto Forum:
  


Current Time: Fri Sep 27 16:00:02 GMT 2024

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

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

Back to the top