JNI is built right into the JVM - in fact some of the most fundamental of the library classes use it to get access to the operating system.
You package your C and C++ into a DLL (windows) or shared library (unix) to which you connect with a System.loadLibrary() call.
To create the hooks, you declare special methods native. Then you run the classes with native methods through the javah comand to generated C headers declaring the methods to which the java connecfs.