java.lang.NoSuchMethodError: javax.media.opengl.GLDrawableFactory.initSingleton()V

后端 未结 2 1630
萌比男神i
萌比男神i 2020-12-21 12:30

I am trying to use the JZY3D libraries in my Java project.

Starting with the basic, I set up the following main():

public static void main(final Stri         


        
相关标签:
2条回答
  • 2020-12-21 12:55

    The jogl-all.jar, gluegen-rt.jar and gluegen.jar files are in the build path. I get the following exception:

    Remove gluegen.jar from the build path. Make sure these two jars are added to the classpath at runtime as well! You only need jogl-all.jar and gluegen-rt.jar (rt == runtime) at compile time and runtime.

    Also you need to have a copy of the matching native jars gluegen-rt-natives-os.and.arch.jar and jogl-all-natives-os.and.arch.jar for the platform you use next to the gluegen-rt.jar and jogl-all.jar http://jogamp.org/jogl/doc/deployment/JOGL-DEPLOYMENT.html#NativeJARFiles

    0 讨论(0)
  • 2020-12-21 13:00

    Have you tried the Maven dependency instead of add those jars by hand?

    I made a clean maven project, add a new user library with the following files:

    • org.jzy3d-0.9.jar
    • dependencies/misc/opencsv-2.1.jar
    • dependencies/misc/org.convexhull.jar
    • dependencies/misc/swt.jar
    • dependencies/misc/swt-debug.jar

    After that, I add the following maven dependencies:

    <dependency>
      <groupId>org.jogamp.gluegen</groupId>
      <artifactId>gluegen-rt-main</artifactId>
      <version>2.0.2</version>
    </dependency>
    <dependency>
      <groupId>org.jogamp.jogl</groupId>
      <artifactId>jogl-all-main</artifactId>
      <version>2.0.2</version>
    </dependency>
    

    Build & Run with no exceptions.


    A much cleaner solution is:

    • Clone Jzy3D repository (https://github.com/jzy3d/jzy3d-api)
    • install jzy3d-master
    • add the jzy3d-api dependency for your project
    0 讨论(0)
提交回复
热议问题