Why JNIWrapper

Simple Integration

Function Call Sample

import com.jniwrapper.AnsiString;
import com.jniwrapper.Function;
import com.jniwrapper.Int;
import com.jniwrapper.Pointer;

 * This class demonstrates how to invoke native functions from dynamic-link libraries (DLL) using
 * the {@link Function} class.

public class FunctionCallSample extends BasicJNIWrapperSample {

     * This method invokes the sumStdCall native function using the STDCALL calling convention.

    public static void returnValueSample() {
        int a = 10, b = 100;
        Function add = SAMPLE_LIB.getFunction("sumStdCall");
        Int result = new Int();
        add.invoke(result, new Int(a), new Int(b));
        System.out.println("The sum of a = " + a + " and b = " + b + " is " + result.getValue());

     * This method invokes the printStringCdeclCall native function using the CDECL calling convention.
     * printStringCdeclCall prints the specified string to the standard output stream on the native side.   

    public static void noReturnValueStdCallSample(){
        String str ="This string was put to the out stream in printStringCdeclCall native function.";
        Function putString = SAMPLE_LIB.getFunction("printStringCdeclCall");
        putString.invoke(null, new Pointer(new AnsiString(str)));

    public static void main(String[] args){

How to Save Money and Time with JNIWrapper

Suppose that there is an existing application, written in C, that monitors conditions on a factory floor, and you need to incorporate this functionality into a Java application.

The traditional approach using JNI involves Java and C developers as well as management coordination to keep the functionality synchronized.

By contrast, using JNIWrapper is trivial and saves time and efforts dramatically.

traditional way
using JNIWrapper



JNIWrapper can handle large amounts of data involved in interactions between the Java and native code, with no tuning on your side.

Extensible Architecture

You can implement new data types or customize existing ones, taking full control over the parameter behavior. See Structures and Unions in our Programmers Guide. See also the related samples: Union Sample, Union Structure.

Custom Search Mechanism

In addition to a default mechanism for finding and loading a native library, JNIWrapper provides a way to customize the library loading. Also, it's possible to load native libraries from JAR files.

Automatic Memory Management

All resources allocated by JNIWrapper are released automatically when no longer needed. You can treat JNIWrapper variables as ordinary Java objects that can be reclaimed by the Java garbage collector. Besides, JNIWrapper objects are safe with regard to finalizers: all resources are guaranteed available during finalization.

Thread-safe Concurrent Function Invocation

You can perform all native function calls simultaneously from different Java threads without the need for synchronization, just as if invoking simple Java methods. See Working with Multithreading in our Programmers Guide.

Native Function Invocation

JNIWrapper supports both stdcall and cdecl calling conventions and multiple C/C++ data types including structures, unions and pointers. Callbacks are fully supported with any parameter and return types and both calling conventions. See Calling Native Functions in our Programmers Guide. See JNIWrapper samples

Catching Native Errors

When you call a native function, JNIWrapper makes all native errors ready for debugging on the Java side, putting program execution completely in your hands. See Calling Conventions in our Programmers Guide.

Code Generation Wizard

Using the Code Generator Wizard bundled with JNIWrapper, you can generate Java wrappers for a required set of C types, including structures, unions and callbacks.


When you purchase JNIWrapper you receive WinPack, a free add-on enabling access to the Windows native API and libraries from Java code. WinPack provides several integration features to make your Java application look and behave like a Win32 citizen. WinPack requires no extensive knowledge of the Win32 API, nor any writing of cumbersome wrapper classes for JNI.

Dialog Boxes

With WinPack, you can use familiar Windows dialog boxes and modify window properties however you choose. See the following samples: Choose Color Dialog, Select Folder Dialog, Open/Save File Dialog.

Access to the Registry

With just a snippet of code you can make your Java application read, write or delete the Windows registry keys and values. Most of the major data types are supported. See the following samples: Registry Key Set Values, Registry Key Enum Values.

Services, Processes and Event Logs

Using the Services API, you can start, stop or delete a service, display all running services in a list, and change the service options. WinPack lets you monitor and manage system processes, modules, memory and event logs. See related samples: Access Services Remote Computer, Enum Processes Sample, Event Log Sample.

Events and File Management

WinPack lets you listen to the file system events. You can also get file attributes, check disk space and identify the disk media type. See the File System Sample.

WinPack Demo

Run the demo winpackdemo.jnlp

Runs on Microsoft Windows XP or later.

The JNIWrapper WinPack Demo is a Windows program and cannot run under another operating system.

To see the Demo, you can do one of the following:

  • Download it and run on Microsoft Windows computer
  • Open this page directly from Windows.

Examples of Apps Our Customers Build

Getting Help

Contact Support

During evaluation period please use the email address, provided to you in the evaluation email.

If you have an active support subscription, please use the email address, provided to you in the email confirming the licence purchase.

Ask a Question

You can ask a question on our product forum. In order to do it, you will need a Google ID.


Send email: jniwrapper-forum@teamdev.com
Your message will be automatically posted on the web.

Evaluation SupportProvided for 30 days

Support Evaluation

Standard SupportProvided for one year with 25% discount for renewal

Support Standard

Premium SupportContract-based time and materials service

Support Premium
Help with the product use Help with the product use Help with the product use
Response within one business day Response within one business day Response within one business day
Provided by email Provided by email Provided by email
Product updates Product updates
Phone, chat and remote desktop
Feature development
Priority issue resolution
Evaluate for Free Request Renewal Request Premium
We actually purchased a licence and we are very happy with the product: great job! This product saves us time since I don't have to write the JNI layer myself. Sébastien Gemme, Canadian Space Agency
...I absolutely love your product. Rob Desilets, Document Systems Inc.
...I have been very impressed with the amount of functionality provided as well as stability and robustness of the product…
Stephen Renner, IP Australia
I am very satisfied with the product as I find the abstraction to the JNI functionality of Java to be quite useful. Adam Acott, Novex Software Development Inc.
...my brief experience with your product, considering my previous experience with JNI, has been highly satisfactory. I have developed in a weekend what took me two weeks at least using other tools. Hector Zendejas, Cardware.biz

Licensing and Pricing

Licence use is governed by the product licence agreement

  • Perpetual Licence Perpetual licence
  • Free Distribution Free distribution within your application
  • Support Updates 1 year Support and updates
  • 25% Discount Support renewal with 25% discount
  • 15% Discount 15% discount on TeamDev products
  • Windows
  • macOS
  • Linux
  • Linux
  • Cross-Desktop
    Win, Mac, Linux
  • Solaris
  • Solaris

Per Developer $

  • Developer 1 developer
  • Unlimited Projects Unlimited projects
  • Support 55 hours of support for 1 year
Buy Now

Project $

  • Developers Unlimited developers
  • Project 1 project
  • Support 75 hours of support for 1 year
Request Licence

Company-wide $

  • Developers Unlimited developers
  • Unlimited Projects Unlimited projects
  • Support 100 hours of support for 1 year
Request Licence

Source Code For 1 Developer

Developers Licence for more developers
is also available for purchase

Java Integration
Pack For 1 Developer

$2,527 $1,999 JNIWrapper, ComfyJ and JExplorer for Windows
Developers Contact us for Project and Company–wide licence options

Download JNIWrapper

  • Windows
  • macOS
  • Linux
  • Linux
  • Cross-Desktop
    Win, Mac, Linux
  • Solaris
  • Solaris

Frequently Asked Questions

Technical Questions

JNIWrapper supports different operating systems and architectures:

  • Windows XP, Windows 2000, Windows Vista, Windows 7, Windows 8 for x86 and x86_64 architectures;
  • Linux for x86, x86_64, PPC and PPC64 architectures;
  • macOS with PCC, x86 and x86_64 architectures, SunOS for x86, x86_64, sparc and sparc64 architectures;
  • AIX PCC.

Please make sure that you set the correct function calling convention. The defaults are: stdcall for Windows as it is used by most of the Windows API, and cdecl for Linux - it is used by almost all libraries.

JNIWrapper is not designed for integration with .NET libraries which were created using C# or any other .NET programming language. In fact such libraries have architecture which completely differs from regular Win DLL libraries. Nevertheless it is possible to integrate with a .NET library if it provides COM Interop level. In this case you can use our ComfyJ product for that.

Technically it’s possible to invoke the functions from such library using JNIWrapper, but it won’t give you the ability to work with C++ objects and their methods. There are two possible workarounds. First is to create the plain C wrapper functions for the required C++ functions from that library. Second one is to enable COM interop in that C++ library and then use our ComfyJ product for integration with it.

The simplest way is to package all required library files (including JNIWrapper libraries) to root folder of an application JAR file.

The simplest way is to package that file to the \META-INF\ subdirectory of an application JAR file.

Yes, you can use Codegen for JNIWrapper utility application to generate the corresponding Java wrapper for it.

Licensing Questions

Our licensing is based on versions of JNIWrapper. Having purchased the licence for our product you get the right to use the current major version of the product.

Major and minor version upgrades issued during your active Standard Support subscription period are free of charge. Upon expiration of the Standard Support subscription you can renew it with a 25% discount from the actual licence price.

You only need to purchase 2 licences. We licence our library by the number of people who write code using our library.

You can distribute unlimited number of copies of your product with our library enclosed.

You may want to purchase a Project licence, which is cost-effective in case there are 3 and more developers on the team. The Project licence is bound to a single project you do, but it allows any number of developers in your company to work with our library.

Project Licence is bound to your project via a fully-qualified class name. A fully-qualified name for a class is the package name followed by the class name, separated by a period (.). For example: com.mycompany.myproduct.MyClass

This can be any class of your application. The only requirement is that it should be included into your Java application class path.

When we say “project” we have in mind one product of your company including your future product versions or potential derivative works based on your product.

The Project licence is tied to one project only.

The best solution would be to purchase the Company–wide licence, which covers any number developers and projects in one company.

Upon the licence purchase you will receive an archive with two types of licence files: development and runtime. Development licence is intended to be used in the development process. Runtime licence is to be used for distribution of your software with JNIWrapper enclosed.

Yes, you can purchase JNIWrapper Source Code Licence; it is provided on a per developer basis. Please contact our sales team if you are interested in this option.

If you are doing an open source or academic project, you can apply for a free licence using links from the section below.

Thank you!

Start your free trial in few simple steps


Check Your Email

Links to download your evaluation licence and distribution archive will arrive at your inbox in a few minutes.

If the message gets lost in your mailbox, try searching for an email from JNIWrapper Evaluation Support with “Your Free 30 Days Trial” subject.


Install the Licence

To start using JNIWrapper

  • download your evaluation licence,
  • install the library JAR file and the licence using the instruction.

Get Started

Take a look at tutorial the to get JNIWrapper up and running in no time.

Find more useful information in the Support Documentation.


Check out the ready-made examples for instructions and ideas on what you can do with your newly gotten JNIWrapper.


Commercial Open Source Academic
  • Windows
  • macOS
  • Linux
  • Linux
  • Cross-Desktop
    Win, Mac, Linux
  • Solaris
  • Solaris

With this licence you will be able to evaluate our product for 30 days.
The evaluation licence will not work after this time, so you will need to purchase the licence.

With this licence you will be able to evaluate our product for 30 days.
The evaluation licence will not work after this time. If you are doing an open source project, you can request a permanent licence via the link provided in the email you will receive.

With this licence you will be able to evaluate our product for 30 days.
The evaluation licence will not work after this time. You can request a licence for duration of your academic project via the link provided in the email you will receive.

You should have an existing open source project which has commits and some life period of the project.

We can provide licences only for projects distributed under non-viral licence (LGPL, Apache, etc.). Our library is proprietary and we will not be able to disclose its code.

Technologies and Platforms
Please list other technologies, it may help in support.