timi95
timi95

Reputation: 368

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 ;

Upvotes: 0

Views: 4025

Answers (2)

Svetlin Zarev
Svetlin Zarev

Reputation: 15683

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

Upvotes: 0

gouessej
gouessej

Reputation: 4075

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.

Upvotes: 1

Related Questions