Skip to content

Instantly share code, notes, and snippets.

@rogerallen
Last active October 8, 2019 18:38
Show Gist options
  • Save rogerallen/1172fd746a6c18c07262e33985552988 to your computer and use it in GitHub Desktop.
Save rogerallen/1172fd746a6c18c07262e33985552988 to your computer and use it in GitHub Desktop.
LWJGL3 on Jetson Nano

Quick Test of LWJGL3 on Jetson Nano

Get Custom build

Go to https://www.lwjgl.org/customize Select

  • Stable (V3.2.3 or later)
  • Mode = "ZIP file"
  • Native = "Linux arm64"
  • Presets = "Minimal OpenGL"

Download the ZIP file. (assumed to go to ~/Downloads/lwjgl-release-3.2.3-custom.zip)

Setup Java

sudo apt-get install openjdk-8-jdk

Setup Code & Library

# make directory for your code
mkdir lwjgl-test
cd lwjgl-test
# make directory for LWJGL library
mkdir lib
cd lib
# adjust source location as necessary
mv ~/Downloads/lwjgl-release-3.2.3-custom.zip .
unzip lwjgl-release-3.2.3-custom.zip

Get Java example code

Save code from https://www.lwjgl.org/guide in file lwjgl-test/HelloWorld.java

Build Java class file

Be inside the lwjgl-test directory when running the following.

javac -cp ".:./lib/lwjgl.jar:./lib/lwjgl-glfw.jar:./lib/lwjgl-opengl.jar" HelloWorld.java

Run Java class file

Add natives to java commandline.

java -cp ".:./lib/lwjgl.jar:./lib/lwjgl-natives-linux-arm64.jar:./lib/lwjgl-glfw.jar:./lib/lwjgl-glfw-natives-linux-arm64.jar:./lib/lwjgl-opengl.jar:./lib/lwjgl-opengl-natives-linux-arm64.jar" HelloWorld

Should output: Hello LWJGL 3.2.3 build 13! and window should pop up with red background.

For a friendlier NVIDIA green, feel free to adjust the clear color like: glClearColor(0.46f, 0.72f, 0.0f, 0.0f);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment