The API of JOCL is very similar to the original OpenCL API. So many of the online
resources available for OpenCL may be applied directly to JOCL programs. Most of
the OpenCL implementation come with a set of samples, which can serve as starting
points for own programs. Some of these samples have also been ported to JOCL, and
may be obtained in the samples
Most of the JOCL JavaDoc API documentation
was extracted from the OpenCL Reference Pages
from the Khronos OpenCL website
For the basic setup of JOCL, you have to follow these steps:
Install an OpenCL implementation. This may be one of the implementations
summarized on the JOCL main page.
Create a project in your favorite IDE
Add the JOCL files to the project. This usually means copying the files
from the appropriate archive in the downloads
section into the root directory of your project.
Add the JAR file to the classpath.
Run one of the samples
Jeff Heaton from Heaton Research
has created this excellent article about setting up a basic project with JOCL, describing
most of these steps in detail:
Programming your Graphics Card (GPU) with Java & OpenCL
The 'Trouble Shooting' section of this article also mentions one the most frequent
error messages when using JOCL (or any other Java binding for a native library):
The famous UnsatisfiedLinkError
. Although this currently targets only JCuda,
maybe you find this FAQ Entry about the UnsatisfiedLinkError
helpful if you also encounter this error.
If you have specific questions about JOCL, you may want to ask them in the
Note that this forum is mainly about JOCL itself. Advanced questions about OpenCL programming
in general may probably receive a greater attention in one of the forums
dedicated to OpenCL:
If you have further comments, hints, suggestions or questions, feel free to contact