eclipse: "MaxObject cannot be resolved to a type"

    Java

    Jennek Geels's icon
    Jennek Geels's icon
    Jennek Geels
    Jan 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

    • nick rothwell | project cassiel's icon
      nick rothwell | project cassiel's icon
      nick rothwell | project cassiel
      Jan 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:// www.cassiel.com
      Share
    • Jennek Geels's icon
      Jennek Geels's icon
      Jennek Geels
      Jan 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
    • nick rothwell | project cassiel's icon
      nick rothwell | project cassiel's icon
      nick rothwell | project cassiel
      Jan 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:// www.cassiel.com
    • Jennek Geels's icon
      Jennek Geels's icon
      Jennek Geels
      Jan 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
    • nick rothwell | project cassiel's icon
      nick rothwell | project cassiel's icon
      nick rothwell | project cassiel
      Jan 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:// www.cassiel.com
    • projects's icon
      projects's icon
      projects
      Jan 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's icon
      f.e's icon
      f.e
      Jan 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
    • Alexandre's icon
      Alexandre's icon
      Alexandre
      May 24 2023 | 9:28 pm
      Hi! i have this error << The type com.cycling74.max.MaxObject is not accessible >> at the beginning import line of every single class in eclipse, while trying to revive my old big modular instrument* max.jar is in the eclipse libraries of the eclipse java project (in classpath) ...i'm a bit lost as i was never super familiar with eclipse
      Any idea ? 🙏
      (*Organic Tones alexbart.org/music )
    • Alexandre's icon
      Alexandre's icon
      Alexandre
      May 25 2023 | 4:04 am
      OK I got rid of the errors in eclipse by checking all the boxes of the jars in “order and export” in the java build path tab… ... They were unchecked I don’t know why, even if the libraries were already there in the tab library, a bit mysterious all of this, but the errors disappeared )