using other classes in a project : class cannot be resolved or is not a type [message #64323] |
Sat, 14 May 2005 21:09 |
Eclipse User |
|
|
|
Originally posted by: user.domain.invalid
When I try to create an object wich depends on another class, eclipse
can't compile the java file ("[OtherClassName] cannot be resolved or is
not a type"). With the command line (javac) on winXP it works well.
The class I want to use is in the same directory as the .java file and I
don't have the source of that file, only the class (but the class works
fine because javac can compile it using command line).
How can I fix this problem?
thanks
|
|
|
Re: using other classes in a project : class cannot be resolved or is not a type [message #64555 is a reply to message #64323] |
Mon, 16 May 2005 11:35 |
Eclipse User |
|
|
|
Originally posted by: geert.serneels_No.spam.gmx.net.invalid
user@domain.invalid wrote:
>
> When I try to create an object wich depends on another class, eclipse
> can't compile the java file ("[OtherClassName] cannot be resolved or is
> not a type"). With the command line (javac) on winXP it works well.
>
> The class I want to use is in the same directory as the .java file and I
> don't have the source of that file, only the class (but the class works
> fine because javac can compile it using command line).
>
> How can I fix this problem?
>
> thanks
No one with an idea?
gs
|
|
|
Re: using other classes in a project : class cannot be resolved or is not a type [message #64759 is a reply to message #64323] |
Mon, 16 May 2005 14:58 |
Eclipse User |
|
|
|
Originally posted by: eclipse.rizzoweb.com
user@domain.invalid wrote:
>
> When I try to create an object wich depends on another class, eclipse
> can't compile the java file ("[OtherClassName] cannot be resolved or is
> not a type"). With the command line (javac) on winXP it works well.
>
> The class I want to use is in the same directory as the .java file and I
> don't have the source of that file, only the class (but the class works
> fine because javac can compile it using command line).
>
> How can I fix this problem?
The .class that you depend on must be included on the build path of the
project, not in its source path.
For example, let's say you have a project like this:
MyProject/
source/
com/
foo/
ClassYouWrite.java
lib/
If the .class that you depend on is in package com.x.y, then you would
place that .class in lib/com/x/y directory and include lib/ on the build
path for the Project.
The Help tutorials would explain this in detail - I urge you to go
through them to better understand Eclipse project structures.
Eric
|
|
|
Re: using other classes in a project : class cannot be resolved or is not a type [message #64828 is a reply to message #64759] |
Mon, 16 May 2005 18:08 |
Eclipse User |
|
|
|
Originally posted by: geert.serneels_No.spam.gmx.net.invalid
Eric Rizzo wrote:
> user@domain.invalid wrote:
>
>>
>> When I try to create an object wich depends on another class, eclipse
>> can't compile the java file ("[OtherClassName] cannot be resolved or
>> is not a type"). With the command line (javac) on winXP it works well.
>>
>> The class I want to use is in the same directory as the .java file and
>> I don't have the source of that file, only the class (but the class
>> works fine because javac can compile it using command line).
>>
>> How can I fix this problem?
>
>
> The .class that you depend on must be included on the build path of the
> project, not in its source path.
>
> For example, let's say you have a project like this:
> MyProject/
> source/
> com/
> foo/
> ClassYouWrite.java
> lib/
>
> If the .class that you depend on is in package com.x.y, then you would
> place that .class in lib/com/x/y directory and include lib/ on the build
> path for the Project.
>
> The Help tutorials would explain this in detail - I urge you to go
> through them to better understand Eclipse project structures.
>
> Eric
source and class files are in the same project directory (small
project). Also the .class I want to use is that project directory.
Shouldn't it be automaticly recognized / in the classpath?
gs
|
|
|
Powered by
FUDForum. Page generated in 0.08182 seconds