Java applications access a Windows DLL by using a JNI (Java Native Interface) wrapper.
The JNI wrapper is a C program that converts Java calls into C calls.
This demo includes sample programs for the java application (AduJava.java) and the JNI
wrapper (AduJava.c). The AduHid.dll library is provided by Ontrak Control Systems Inc as a
binary file.
The run-time component of AduJava.java is the compiled byte codes in AduJava.class. The
run-time component of AduJava.c is the AduJava.dll library. The following diagram shows
how the source code relates to the run time components.
The AduJava example was created as follows:
- The AduJava.java main program is typed in using a text editor.
- The javac compiler converts the AduJava.java source code into AduJava.class byte codes.
- The javah tool creates the AduJava.h JNI header file.
- A text editor was used to create the AduJava.c source code file for the JNI wrapper.
- A C compiler creates the AduJava.dll wrapper library.
- The java launcher runs the AduJava application.
Here is a graphic of the files, tools and their relationships.
AduJava Help File Version 1.0.0.0
Copyright 2005 Ontrak Control Systems Inc.
|