blaffie
blaffie

Reputation: 505

JOGL OpenGL in Eclipse throwing NoSuchMethodError

I'm want to learn OpenGL using Java. I have no experience using OpenGL but I am comfortable with Java.

The plan is to use JOGL in Eclipse Indigo. To get started a simple hello world application was written from Schabby's Blog. The source for my application is the same.

I follow all steps and reference the gluegen-rt-natives-windows-amd64.jar, gluegen-rt.jar, jogl-all.jar and jogl-all-natives-windows-amd64.jar libraries. The application is configured to run in JRE6 x64.

When I run the application the following exception is thrown:

Exception in thread "main" java.lang.NoSuchMethodError: jogamp.common.awt.AWTEDTExecutor.invoke(Ljava/lang/Object;ZZLjava/lang/Runnable;)Z

Other answers suggests that the problem is with the main method, however I do not see any problems with it.

public static void main(String[] args) 
{
       \\Implementation
}

What else can I try to solve this problem?

EDIT: It seems the exception is thrown every time something needs to be drawn.

If I comment this line frame.setSize( frame.getContentPane().getPreferredSize() ); a default frame with minimum width and height is shown but as soon as I re-size the same exception is thrown.

Upvotes: 0

Views: 406

Answers (1)

Gene
Gene

Reputation: 46960

This is the top level exception thrown when the native libraries can't be loaded. See the documentation on local installation and follow carefully.

First make sure that the JRE Eclipse is using is actually 64-bit. Your behavior is consistent with trying to load 64-bit DLLs in a 32-bit JRE.

Note also the blog is somewhat dated. For example jogl.all.jar is now jogl-all.jar. Make sure your jar references are to the correct files. You might get better results with this set of instructions, which is based on the current release.

The natives jar is expanded at run time. The directory where this jar is stored must be writeable for this mechanism to work. I usually go through the more detailed procedure of using the expanded DLL/jnilib/so files and setting java.library.path to eliminate all doubt.

Upvotes: 1

Related Questions