Forums > Java

eclipse: "MaxObject cannot be resolved to a type"

January 23, 2006 | 5:36 pm

Hi,
maybe this has been asked before, but I am still a bit puzzled by the
new forums and
the way they are to be searched

I am moving my java development from the quickie environment to eclipse.
Classes that were OK in quickie fail to compile in eclipse.
Error message "MaxObject cannot be resolved to a type"

I have included as ‘external jars’ in the Build Path for my project
/Library/Application Support/Cycling ’74/java/lib/jitter.jar
/Library/Application Support/Cycling ’74/java/lib/jode-1.1.2-pre-
embedded.jar
/Library/Application Support/Cycling ’74/java/lib/max.jar
and in the package explorer from eclipse I can see MaxObject.class
in package ‘com.cycling74.max’ in file ‘max.jar’ in ‘/Library/
Application Support/Cycling ’74/java/lib/’

the .java files begins with
"import com.cycling74.max.*;"

I am on:
Eclipse 3.1
Java 5.0
MaxOS 10.4.4
Max 4.5.5

I am new to eclipse, and have only begun to explore java recently.
However, I have worked with OO and IDEs for a loong time.
My motivation for moving to eclipse is to include my Swing based code
fragments
into mxj classes.

aTdHvAaNnKcSe
-jennek


January 23, 2006 | 6:35 pm

I can’t see anything obviously wrong with what you’ve done in terms
of setup. (You don’t need Jode, by the way.) I’ve tested in my
Eclipse setup, and the error message does indeed seem to be a compile-
time "name not found" error.

> the .java files begins with
> "import com.cycling74.max.*;"

If you replace this with an explicit import of
com.cycling74.max.MaxObject, what happens?

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


January 23, 2006 | 6:47 pm

That does the trick. I have to include all the types I use
explicitly. Like:

import com.cycling74.max.MaxObject;
import com.cycling74.max.Atom;
import com.cycling74.max.DataTypes;

Hm. Funny this expansion is required.
Anyway, I can move on now.
Thanks!
-jennek


January 23, 2006 | 7:36 pm

Well if that does the trick, then there’s something wrong somewhere.
I’ve just had a flick through the Java Language Specification, and
see no reason why a "com.cycling74.max.*" should not pick up all of
the above. (I thought there might be some semantic subtlety related
to classpath construction, but there isn’t.) I tried it in my Eclipse
setup, and can use "*" or the fixed name without any problems.

Fancy posting some of your source code? There maybe something odd in
there that you’ve missed.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


January 23, 2006 | 7:58 pm

Sure, but…
As I tried to isolate a snippet of code demonstrating the problem,
the error message went away. When I loaded the original full source,
the problem did not return. everything builds and runs nicely now.

A veritable heisenbug: once you start looking for it, it vanishes.

Let’s wait and see.
Thanks
-jennek


January 23, 2006 | 10:17 pm

On 23 Jan 2006, at 20:01, jennek geels wrote:

> As I tried to isolate a snippet of code demonstrating the problem,
> the error message went away.

Eclipse sometimes does that, and you have to clean and rebuild the
class files. Don’t know why.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


January 27, 2006 | 7:58 am

Since I upgraded to Eclipse 3.1 I sometimes have the same problem. I think it is a bug. Relaunching the environment seems to fix the compilation errors. I’m going to try to downgrade.

Ben



f.e
January 27, 2006 | 8:35 am

I never had any kind of troubles with 3.1.1. Why don’t you don’t move to
it ? Notice that there’s a 3.1.2 since a week. I didn’t installed it yet
because i haven’t find any insurance of CDT 3.0.1 compatibility with,
but a lots of bugs were fixed for Java only. Take a look.

Anyway, did you tried to check the box of the max.jar in the Order And
Export Pane in the Java Build Path properties ? It fixed a lot of
"linking" problems for me.

best

f.e


Viewing 8 posts - 1 through 8 (of 8 total)