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

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

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

The prices on this page are exclusive of any taxes.

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

What platforms does JNIWrapper support?

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.

I am calling a function with correct number of parameters, but keep getting an exception about incorrect parameter types.

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.

I would like to invoke a function from a DLL that I generated with C# using JNIWrapper. Is it possible?

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.

Is it possible to integrate with a C++ library using JNIWrapper?

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.

How I can redistribute native JNIWrapper library (jniwrap.dll, jniwrap64.dll, etc.) with my application?

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

Where should I put my JNIWrapper license file (jniwrap.lic)?

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

Is there a way to create Java wrapper for a particular native type having only its C definition?

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

How do I configure the license?

Licensing Questions

What is your licensing based on?

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.

Can I receive a free upgrade?

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.

What are the terms for using JNIWrapper?

Please take a look at the Product License Agreement.

There are 6 people on our team, and 2 of them need to use JNIWrapper. How many licenses do we need to purchase?

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

If we take a developer, working with JNIWrapper, off the project, can we reassign the license to another developer?

This is possible with the Per Developer License.

How many copies of my product can I distribute with JNIWrapper included?

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

We have 5 people, who work with JNIWrapper on one product.

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.

How is a Project License bound to my project?

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

Which class can be used for binding the license?

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

What’s the definition of “project” in terms of the Project License?

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.

Will we be able to use the Project License in another project we do?

The Project License is tied to one project only.

We’d like a license for multiple projects for a team of developers, what would you offer?

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

How do I find the license file?

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.

We need to look at the Source Code of JNIWrapper, do you provide it?

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.

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.

Free 30-day trial

We will email you your trial key and a quick start guide.

  • I have read and agreed to the terms of the product license agreement.
  • I agree with the processing of my personal information. We collect your personal information to identify you as our customer and provide you with our products and services. Check out our privacy statement.