Cannot compile jME under Eclipse on Mac OS X 10.6.1

I am running Mac OS X 10.6.1 using Eclipse JEE 2.5 SR1 (32-bit Cocoa)



I got the jME engine from SVN but I'm receiving the following 3 errors when it tries to build:


Description   Resource   Path   Location   Type
The method dispose() is undefined for the type GLCanvas   LWJGLSWTCanvas.java   /jme/src/com/jmex/swt/lwjgl   line 237   Java Problem
The method dispose() is undefined for the type GLCanvas   LWJGLSWTCanvas.java   /jme/src/com/jmex/swt/lwjgl   line 251   Java Problem
The method dispose() of type LWJGLSWTCanvas must override or implement a supertype method   LWJGLSWTCanvas.java   /jme/src/com/jmex/swt/lwjgl   line 234   Java Problem



I'm very new to jMe and Eclipse.

Can anyone help me eliminate these errors?

Thanks in advance.

you will first want to make sure that the lwjgl native libraries are on your buildpath…  



Right click the jME project, click properties, and then select "Java Build Path" from the options on the left…

Now click the 'Libraries' tab and clack the arrow next to "lwjgl.jar' to drop it down… select "Native library locations" and select the "Edit…" button

add "jme/lib/lwjgl/native/macosx" for your location path (no quotes), and click ok on that window and the "Properties for jme" window…





Try building again :slight_smile:



EDIT: oops! i forgot to address the SWT issue :stuck_out_tongue:



at the libraries tab you were at before where you were able to drop down lwjgl.jar, click "Add JARs…" and select jme/lib/swt/macosx-cocoa/swt_fake.jar

I am getting exactly the same issue. The three build errors mentioned above are appearing when i attempt to compile. Has this issue been resolved?



I set the native library location for lwjgl to jme/lib/lwjgl/native/macosx

I included the swt jar from jme/lib/swt/macosx-cocoa/swt_fake.jar



I am running on a 32 bit MacBook Pro, Mac OS X version 10.6.1



Help is greatly appreciated!

I don't know if this helps at all, but I guess more information is better.



I installed the latest version of the Java EE SDK on my machine. Update 7

Just to be clear, you are building by doing this:


  • right-click build.xml, select Run As -> 2 Ant Build



    correct?



    What options are you choosing when you build? dist-all should be all you need.



    EDIT: Are you using an SVN checkout like the OP?

I ran into the same issue. I just commented out the two calls to super.dispose() and the @Override line (line 233) and it compiled for me. I've been running it and haven't run into issues with that fix yet.



Hope that helps

despotes said:

I ran into the same issue. I just commented out the two calls to super.dispose() and the @Override line (line 233) and it compiled for me. I've been running it and haven't run into issues with that fix yet.

Hope that helps


You did this in the LWJGLSWTCanvas class?

That is correct. It doesn't look like GLCanvas has a dispose() method in swt_fake.jar. However, I just went back to look to double check and it looks like calling super.getDisplay().dispose() may be the correct way to fix it. I don't really know, since I'm not familiar with the innards of lwjgl yet. Though, I suppose since it's a "fake" jar, it doesn't matter anyway, other than it would be nice if it compiled without modification.

So I took a look at it again and it appears when i use the cocoa swt at jme/lib/swt/macosx-carbon/swt.jar it compiles fine, but when i use the fake jar, the errors mentioned above appear. I will try out the code modifications mentioned above.

So here is a new thing, when i run the build.xml build script it compiles successfully, but when i do the normal eclipse build it fails. I don't know enough about eclipse to know why that would happen.

What's the build error? My first guess is classpath issue. You can check your included libs by right clicking the jme project -> properties -> java build path -> libraries



If you give more description of the error eclipse is giving you, I can probably help more

There are three build errors. They are listed in the first post on this thread by mconwell.