Newbie question: using existing classes [message #87079] |
Wed, 20 August 2003 08:20  |
Eclipse User |
|
|
|
Originally posted by: crabtree8.xs4all.nl
Hi group,
I have a java sourcefile that uses (imports) a couple of class files. I've
created a new project in Eclipse and imported the sourcefile and copied
the class files, but the import statement that refers to the class library
generates an error: 'the import xxx cannot be resolved.'
I can't get this to work. I tried to add a classpath variable, it did not
work. The class files are there, in the subfolder, why would there be a
problem?
I compiled and ran the java file from the command line and in the Netbeans
IDE, and everything worked fine. I guess I am overlooking something very
simple.
I really would appreciate an answer... I am getting somewhat frustrates :(
TIA, Mark.
|
|
|
|
|
|
Re: Newbie question: using existing classes [message #87171 is a reply to message #87125] |
Wed, 20 August 2003 09:49   |
Eclipse User |
|
|
|
Originally posted by: crabtree8.xs4all.nl
Adam Kiezun wrote:
> > Sorry, forgot to mention it, I have tried this. But then I get an error
> > 'cannot nest 'test/xxx' in test', where 'test' is the project folder and
> > 'xxx' is the new folder with the class files.
> but what does the rest of the message say, ha? :-)
> 'to enable the nesting exlude 'xxx' from from 'test''
> to do that, go to the 'Source' tab, expand the project node, double click on
'Exclusion filter' and add the 'xxx' folder
> hth
> a.
> --
> eclipse.org
Hi Adam,
Thanks, I did that, but now my project could not be built because the
build path is incomplete?
I deleted the project, created a new one and imported all the files. I
didn't add a class folder to the build path. Now... I don't get the
original problem again ('import xxx cannot be resolved'), now it's 'the
import xxx is never used'. And a declaration of an instance of a class in
the class folder gives 'myclass can not be resolved (or is not a valid
type) for the field myvar'
Then if I add a class folder and enable the nesting, again I get an error
'The import xxx cannot be resolved'
Mark.
|
|
|
|
Re: Newbie question: using existing classes [message #87245 is a reply to message #87191] |
Wed, 20 August 2003 11:36   |
Eclipse User |
|
|
|
Originally posted by: crabtree8.xs4all.nl
Adam Kiezun wrote:
> try this:
> create a new project 'test'
> create a source folder 'src' in 'test'
> create a folder 'xxx' in 'test'
> put the 'xxx' folder on the classpath as a class folder (no exclusion should
be necessary now)
> copy your classfiles to xxx
> copy your sources to src
> btw. i understand that the classfiles are some precompiled classfiles you're
only referencing, not the classfiles for your own
> sources from 'src'
> a.
> --
> eclipse.org
Ok, I did this. Now the source file and the class files show up in the
package explorer. Yes, the classfiles are precompiled, they are not my
own. They are from the anfy3dAPI, a 3d graphics library.
Now my project can't be built: 'The project was not built since its build
path is incomplete. Cannot find the class file for a3dAPI.anfy3dAPI...' I
put the class files in a class folder named 'a3dAPI', the same folder name
as in the zip file they came in. I also tried a class folder named 'xxx',
same result. I don't know if this is an error in the build path or has
something to do with the class files?
Anyway, since I am not sure what I'm doing maybe I'd better go back to the
Netbeans IDE...
Thanks for you help!
greetings, Mark.
|
|
|
|
|
Re: Newbie question: using existing classes [message #87422 is a reply to message #87274] |
Wed, 20 August 2003 17:24  |
Eclipse User |
|
|
|
Originally posted by: crabtree8.xs4all.nl
I experimented a bit with zipfiles and jar files but no success... I just
don't know enough about this to continue. I'm fed up with build paths an
project files now so i'll try something else :(
Thanks,
Mark.
|
|
|
Powered by
FUDForum. Page generated in 0.10594 seconds