//------------------------------------------------------------------- // ShowEflags.java // // This example shows how a Java program can call an external // function that was written in the C++ programming language. // It is adapted a demo in "Core Java 2, Volume II (2nd Ed.)" // by Horstmann and Cornell, Prentice-Hall (2005), pp831-834. // Note that our 'ShowEflags.cpp' companion-file is required. // // compile using: // $ javac ShowEflags.java // $ g++ -fPIC -shared -o libShowEflags.so ShowEflags.cpp // // execute using: // $ export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH // $ java ShowEflags // // // NOTE: Developed using the Fedora Core 3 Linux distribution // (kernel version 2.6.9-1.667) as installed in November 2005 // // programmer: ALLAN CRUSE // written on: 01 JUN 2005 //------------------------------------------------------------------- class ShowEflags { public static native void output(); public static void main( String[] args ) { output(); } static { System.loadLibrary( "ShowEflags" ); } }