How to add JOGL to a Gradle project

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add JOGL to a Gradle project

Fiskpinnar
Hello,

I am completly new to JOGL and I am having a hard time getting started. I’ve seen some examples using Gradle and JOGL like Modern JOGL Examples but I can not get them to start. I have problems with the dependencies.

So my questions are, if I have a barebone Gradle project, where do I add the JOGL jars and what should my settings in build.gradle be?

Do I have to use a specific version of Java?

Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: How to add JOGL to a Gradle project

gouessej
Administrator
Hello

There is a simple official example using quite modern OpenGL here:
https://jogamp.org/cgit/jogl-demos.git/tree/src/demos/es2/RawGL2ES2demo.java?id=HEAD

You can even use Java 8 but it works with Java 16 too.

Maybe it helps:
https://jogamp.org/cgit/ardor3d.git/tree/ardor3d-jogl/build.gradle
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: How to add JOGL to a Gradle project

Fiskpinnar
This post was updated on .
Thank you for the help. I do not succeed in compiling the example though. I follow the instructions line by line but I get a lot of importing errors like this:

demos\es2\RawGL2ES2demo.java:31: error: package com.jogamp.opengl does not exist

This is the same error I got on every other example I have tried to run also. I am using Windows 10 x64 and have tried both compiling with Java 16 and Java 8. What am I doing wrong here?

EDIT: Windows is using ; instead of : to seperate the jar files in the commands used to import it. Now The example works.
Reply | Threaded
Open this post in threaded view
|

Re: How to add JOGL to a Gradle project

gouessej
Administrator