"normally" you include gluegen-rt.jar and jocl.jar on the classpath
gluegen-rt will then look for its natives inside the jar gluegen-rt-natives-linux-amd64.jar next to the gluegen-rt.jar and jocl.jar will look for its natives inside jocl-natives-linux-amd64.jar next to the jocl.jar
if that fail then it will try load the natives from the natives/linux-amd64 inside the main jar
and if that also fail then it will try load the natives from the natives/linux-amd64/ folder on the filesystem.
example 1 if you have built gluegen jocl and jocl-demos manually then the following command line will launch HelloJOCL
java -cp jocl-demos/build/jar/jocl-demos.jar:gluegen/build/gluegen-rt.jar:jocl/build/jar/jocl.jar com/jogamp/opencl/demos/hellojocl/HelloJOCL
I had gluegen.jar as well as gluegen-rt.jar on the classpath and that was why it didn't work. When I took gluegen.jar out of the classpath, it worked. Also it worked if I had both of those, and also included jocl-natives-linux-amd64.jar . But it did not work when I had gluegen.jar and gluegen-rt.jar without the third. That was the issue.