import com.jinvoke.JInvoke; import com.jinvoke.NativeImport; //编译是需要带上jinvoke.jar即:java -classpath .;jinvoke.jar HelloWindows public class HelloWindows{ @NativeImport(library="User32") public static native int MessageBox(int hwnd, String text, String caption, int type); //windows Api MessageBox函数原型 public static void main(String[]argc){ JInvoke.initialize(); MessageBox(0,"Thisi MessageBox is a native Win32 MessageBox", "Hellow World",0); } }