DEV Community

Shawon Saha
Shawon Saha

Posted on

1 1 1 1 1

Run Java OpenGL (JOGL) on Linux

At first, make sure you have java installed on your system. To check that open Terminal (ctrl + alt + t) and run java -version

OpenJDK Linux

If you don't see any version then you have to install OpenJDK on your system. To do that run these two commands

sudo apt-get install openjdk-11-jre
sudo apt-get install openjdk-11-jdk

and check your java -version again.

Once you successfully install java on your system then you have to install JOGL. To do that run this command on terminal.

sudo apt-get install libjogl2-java

After installing JOGL install eclipse

Now Open Eclipse and Create a Java project and give your project a name.

Create a Java Project
You can also find it under File > New > Java Project

After giving a nice name in your project Click Next
Project Name

From the Libraries select Classpath and click Add External JARs Add External JARs

Navigate to /usr/share/java/ and choose these two files jogl2.jar and gluegen2-rt.jar.If you import correctly then You should see those file's paths under Classpath. Now click Finish (You can skip creating Module).
image

Now expand your project from the sidebar and right-click on src then Create a new class

image

If everything is done correctly a Canvas window will pop up after running your JOGL code!

image

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (1)

Collapse
 
philopaterwaheed profile image
philo san

hey so it's a good tutorial but very specific to eclipse I've searched a lot on how to compile using the java compiler and link jogl but didn't find any

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay