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.setCallingConvention(Function.CDECL_CALLING_CONVENTION);
        putString.invoke(null, new Pointer(new AnsiString(str)));
    }

    public static void main(String[] args){
        returnValueSample();
        noReturnValueStdCallSample();
    }
}

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

Features

High-Performance

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.

WinPack

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 license purchase.

Ask a Question

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

links.teamdev.com/jniwrapper-forum

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 license 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

License use is governed by the product license agreement

  • Perpetual Licence Perpetual license
  • 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
    32/64-bit
  • macOS
    ppc32/x86/x64
  • Linux
    x86/x64
  • Linux
    ppc32/ppc64
  • Cross-Desktop
    Win, Mac, Linux
  • Solaris
    x86/x64
  • Solaris
    ultraSPARC
  • IBM AIX
    ppc32

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 License

Company-wide $

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

Source Code For 1 Developer

$
Developers License for more developers
is also available for purchase

Download JNIWrapper

for
  • Windows
    32/64-bit
  • macOS
    ppc32/x86/x64
  • Linux
    x86/x64
  • Linux
    ppc32/ppc64
  • Cross-Desktop
    Win, Mac, Linux
  • Solaris
    x86/x64
  • Solaris
    ultraSPARC
  • IBM AIX
    ppc32

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 license 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 license price.

You only need to purchase 2 licenses. We license 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 License, which is cost-effective in case there are 3 and more developers on the team. The Project License is bound to a single project you do, but it allows any number of developers in your company to work with our library.

Project License 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 License is tied to one project only.

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

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

Yes, you can purchase JNIWrapper Source Code License; 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 license using links from the section below.

Thank you!

Start your free trial in few simple steps

1
Email

Check Your Email

Links to download your evaluation license 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.

2
Licence

Install the License

To start using JNIWrapper

  • download your evaluation license,
  • install the library JAR file and the license using the instruction.
3
Start

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.

Examples

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

Evaluate

Commercial Open Source Academic
  • Windows
    32/64-bit
  • macOS
    ppc32/x86/x64
  • Linux
    x86/x64
  • Linux
    ppc32/ppc64
  • Cross-Desktop
    Win, Mac, Linux
  • Solaris
    x86/x64
  • Solaris
    ultraSPARC
  • IBM AIX
    ppc32

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

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

With this license you will be able to evaluate our product for 30 days.
The evaluation license will not work after this time. You can request a license 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 licenses only for projects distributed under non-viral license (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.
  • I have read and agree to the terms of the product license agreement
  • We collect your personal information to identify you as our customer and provide you with our products and services.
    Check out our privacy statement.

    I agree to processing of my personal information.
  • We would like to send you information on upgrades and offers whenever we feel the new version or product is useful for your development.
    You can unsubscribe from emailing at any time.

    I agree to receive suggestions for products upgrades and offers.