JNAerator
Encyclopedia
JNAerator is a computer programming
Computer programming
Computer programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages. The purpose of programming is to create a program that performs specific operations or exhibits a...

 tool
Programming tool
A programming tool or software development tool is a program or application that software developers use to create, debug, maintain, or otherwise support other programs and applications...

 for the Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

 programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 which automatically generates the Java Native Access
Java Native Access
Java Native Access provides Java programs easy access to native shared libraries without using the Java Native Interface. JNA's design aims to provide native access in a natural way with a minimum of effort...

 (JNA) or BridJ code needed to call C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 and Objective-C
Objective-C
Objective-C is a reflective, object-oriented programming language that adds Smalltalk-style messaging to the C programming language.Today, it is used primarily on Apple's Mac OS X and iOS: two environments derived from the OpenStep standard, though not compliant with it...

 libraries from Java code.

It reads in ANSI C
ANSI C
ANSI C refers to the family of successive standards published by the American National Standards Institute for the C programming language. Software developers writing in C are encouraged to conform to the standards, as doing so aids portability between compilers.-History and outlook:The first...

 header files and emits Java code. Some optional customization can be done through command line options, which can be saved in configuration files.

JNAerator does not need any native compiling beyond that of the targeted dynamic library (all of the glue code is in Java), which helps simplify the process of binding Java to C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 native libraries when compared to Java Native Interface
Java Native Interface
The Java Native Interface is a programming framework that enables Java code running in a Java Virtual Machine to call and to be called by native applications and libraries written in other languages such as C, C++ and assembly.-Purpose and features:JNI enables one to write native methods to...

 (JNI)-based means.

Its output is typically larger and harder to use than hand-crafted JNA bindings, but it saves time and effort for bindings of large libraries with JNA.

JNAerator Studio

While JNAerator is mainly a command-line-based tool, it also contains a limited GUI that's ideal for simple quick generation experiments.

It can be launched from the Web using the direct WebStart link from the project's main page, or by double-clicking on JNAerator's JAR executable archive.

Uses

NativeLibs4Java gathers a few JNAerator-generated Java wrappers for native libraries:
  • JavaCL and OpenCL4Java, OpenCL
    OpenCL
    OpenCL is a framework for writing programs that execute across heterogeneous platforms consisting of CPUs, GPUs, and other processors. OpenCL includes a language for writing kernels , plus APIs that are used to define and then control the platforms...

     library
  • Mono4Java : Mono/.NET
    Mono (software)
    Mono, pronounced , is a free and open source project led by Xamarin to create an Ecma standard compliant .NET-compatible set of tools including, among others, a C# compiler and a Common Language Runtime....

     embedding API
  • MacOS X Frameworks, work being integrated to Rococoa

See also

  • Gluegen
    Gluegen
    GlueGen is a Java tool which automatically generates the Java and Java Native Interface code needed to call C libraries from Java code. It reads in ANSI C header files and GlueGen configuration files, and emits C code...

    , a similar tool used by the Java OpenGL
    Java OpenGL
    Java OpenGL is a wrapper library that allows OpenGL to be used in the Java programming language. It was originally developed by Kenneth Bradley Russell and Christopher John Kline, and was further developed by the Sun Microsystems Game Technology Group. Since 2010, it has been an independent open...

     (JOGL) project but needs compiling of native code and provides added runtime features such as argument bounds checks (this Wikipedia page was copied over and adapted from there)
  • SWIG
    SWIG
    SWIG is an open source software tool used to connect computer programs or libraries written in C or C++ with scripting languages such as Lua, Perl, PHP, Python, R, Ruby, Tcl, and other languages like C#, Java, Modula-3, Objective Caml, Octave, and Scheme...

    , another free computer software
    Computer software
    Computer software, or just software, is a collection of computer programs and related data that provide the instructions for telling a computer what to do and how to do it....

     tool used to connect programs
    Computer program
    A computer program is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute...

     written in C
    C (programming language)
    C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

    /C++
    C++
    C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

     with various scripting language
    Scripting language
    A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...

    s, and to C# and Java
    Java (programming language)
    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

    . It also needs native compiling.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK