Digilent Waveforms AD2 SDK Java Implementation
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



This library is a Java implementation of the Digilent Waveforms AD2 SDK. A C++ and Python SDK is provided by Digilent, but no Java SDK existed. The entire API is not yet implemented and this project is a work in progress.

OS Progress
MacOS Working
Linux Working
Windows 10 Working

This library should work for your Java-based Waveforms app by simply adding the jar to your app's classpath. However, if you need to add more API features that are not yet implemented, then the rest of this readme file explains how to do that.

Pre-requisites for Development

See separate instructions for different operating systems.

Accessing the AD2 SDK from Java

The SDK for the Digilent Analog Discovery 2 comes in the form of a compiled C++ framework. On Mac OSX, this comes in the form of a *.framework file, which is described above. On a Windows system, the SDK is a .DLL. In order to interact with the SDK with our Java app, we use Java JNI.

In single class called DWF is where our Java app code interacts with the SDK. DWF stands for Digilent Waveform. Note that in our DWF class, a static block is used to load the JNI library. We need to create this library manually and it's not provided By Digilent.

static {
  try {
    if (OSUtils.isMac()) {
    else if (OSUtils.isLinux()) {
    else if (OSUtils.isWindows()) {
  } catch (IOException e) {

The waveforms4j.dylib, waveforms4j.so and waveforms4j.dll file is something we need to create ourselves. This file is the JNI bridge between our Java code and Digilent's binary SDK.


A simple test to see if the JNI library works is to run AnalogOutSine.java. If you don't see any exception thrown, that means it's probably working.

Some Resources

  1. Adept SDK Docs
  2. Waveforms Downloads
  3. Analog Discovery 2 Reference Manual
  4. Digilent's DWF library wrapper for python
  5. Waveforms3 Manual

Building the Jar


mvn clean package
mvn clean install  
mvn javadoc:javadoc  

Since we moved the JNI libs into src/main/resources in the above step, they are bundled in the jar.


mvn license:check
mvn license:format
mvn license:remove

Getting the Jar

The waveforms4j release artifacts are hosted on Maven Central.

Or if you use Maven, add the following to your pom file:


For snapshots, add the following to your pom.xml file: