Note on Netbeans 8
Installing C/C++ Plugin for Apache Netbeans 13
Windows: Installing C/C++ Plugin for Apache Netbeans 13
A Simple Java/C++ Project in NetBeans IDE
A Closer Look at JNI Header Files
In this section, I discuss how to setup the mixed Java/C++ development in Eclipse IDE.
Setting up C/C++ Development in Eclipse IDE
Configuring External Tool to Generate Header Files
Configuring External Tool for JDK 9 or Later
Exporting Java Project to jar File With Dynamic Libraries
In this section, I discuss the most important concepts you need to learn in order to do mixed Java/C++ development.
Overloading Native Methods
Overriding Native Methods
Signature of Overloaded Native Methods in C++ (Part 1)
Signature of Overloaded Native Methods in C++ (Part 2)
Order of Execution for Static Initializers in the Class Hierarchy
Working with JNI Primitive Types
Working with Primitive Arrays
Working with Object Arrays
Working with Strings
In this section, I discuss some of the advanced features of JNI including the callback functionality.
Accessing Instance Fields of a Java Class in C/C++
Accessing Static Fields of a Java Class in C/C++
Setting Fields of Java Class in C++
Local Caching of Field IDs in C++
Global Caching of Field IDs in C++
Calling Instance Methods of a Java Class in C/C++
Calling Static Methods of a Java Class in C/C++
Calling Methods of a Java Interface in C++
Creating and Returning Java Objects from C++ Code
In this section, I walk you through how to use JNI to link against a C++ library such as GNU Scientific Library.
Downloading and Installing GNU Scientific Library (GSL)
A Simple Example of Java/C++ Library Linking
Working with Boxed Primitives (Wrappers) and List in C++
In this section, I discuss some features of JNI that are not typically used under normal circumstances.
Nonvirtual Call of Methods of a Java Class in C++
Linking Against Static C++ Libraries
Working with Generic (Parameterized) Methods
Working with Generic (Template) Classes
Working with Java Reflection API (Method & Field) in C++
Working with Java Constants (static final) in C++
Using Fortran Libraries
In this section, I discuss how to instantiate inner classes and implement their native methods in C++
Generating Header files for Nested Inner Classes
Instantiating Nested Inner Classes in C++
Implementing Native Methods of Inner Classes
Implementing Native Methods of Method-Local Inner Classes
Implementing Native Methods of Anonymous Classes
In this section, I discuss how to work with native resources such as native input file streams and output file streams.
Managing Native Resources with JNI
Resolving Native File Stream Conflicts
Working with Standard Input
Working with Standard Output
In this section, I discuss how to detect and handle java exceptions in C++ when developing JNI applications
Handling Java Exceptions
In this section, I discuss several useful tips about JNI.
The "auto" Keyword in C++
Don't Locally Cache jclass When Creating New Objects in C++
JNI Development on Windows Operating System
C++ Debug vs. Release Compilation Mode
Working with Maven Build
Distributing C++ Source Code of JNI Project
JNI Development on Linux Operating System
Regular vs. Critical Access to Primitive Arrays in C++
Regular vs. Critical Access to Java Strings in C++
Creating and Working With an "Unsafe" Class
The Power of "RegisterNatives" Function of JNI
Working with JNI Without Creating Any Header Files
Solving the Refactoring Problem Once and For All
Using JAR files in C++
Understanding javap tool
C++ Classes and Structs in Java
In this section, I walk you through the online Oracle's documentation on Java Native Interface (JNI)
Chapter 1: Introduction
Chapter 2: Design Overview -- Part 1
Chapter 2: Design Overview -- Part 2
Chapter 3: JNI Types and Data Structures
Chapter 4: JNI Functions -- Part 1
Chapter 4: JNI Functions -- Part 2
Chapter 4: JNI Functions -- Part 3
Chapter 4: JNI Functions -- Part 4
Chapter 4: JNI Functions -- Part 5
Chapter 4: JNI Functions -- Part 6
Chapter 4: JNI Functions -- Part 7
Chapter 4: JNI Functions -- Part 8
In this section, I review a useful online article about best practices when using JNI. The link to the article is: https://developer.ibm.com/languages/java/articles/j-jni/#
Best Practices of JNI -- Part 1
Best Practices of JNI -- Part 2
Best Practices of JNI -- Part 3
Best Practices of JNI -- Part 4
Best Practices of JNI -- Part 5
Best Practices of JNI -- Part 6
Best Practices of JNI -- Part 7
Best Practices of JNI -- Part 8
Resources (Source Codes, PowerPoints, References, ...)
Java Source Code