简体   繁体   中英

Java OpenGL install in ubuntu Linux?

Trying to install Java Opengl and keep getting this error

Exception in thread "main" java.lang.InstantiationError: com.jogamp.common.util.locks.RecursiveLock
at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:491)
at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:178)
at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:169)
at Simple.<init>(Simple.java:43)
at Simple.main(Simple.java:20)

what does this mean and what can I do to fix it ?

I'm using Ubuntu 64 bit 14.04 with intel i5processor IDE:Eclipse ;

Please uninstall any JOGL package and follow the official instructions available here and the instructions for the IDEs here .

I have used JOGL under GNU Linux since 2006 without any trouble. Good luck.

You first have to uninstall JOGL from the packet manager if you have already installed it. Then in your project you have to add the necessary libraries to the build path. If you are using maven add this to your dependencies:

<dependencies>
    <dependency>
        <groupId>org.jogamp.jogl</groupId>
        <artifactId>jogl-all-main</artifactId>
        <version>${jogl-version}</version>
    </dependency>

    <dependency>
        <groupId>org.jogamp.gluegen</groupId>
        <artifactId>gluegen-rt-main</artifactId>
        <version>${jogl-version}</version>
    </dependency>
</dependencies>

Where ${jogl-version} is property defining the JOGL version. You can either use the property or hard-code the version you want to use:

<properties>
    <jogl-version>2.2.1</jogl-version>
</properties>

If you are not using maven you should follow the steps from the project's wiki page: https://jogamp.org/wiki/index.php/Setting_up_a_JogAmp_project_in_your_favorite_IDE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM