Source of ShowMessage.java


  1: //: appendixb:ShowMessage.java
  2: // From 'Thinking in Java, 2nd ed.' by Bruce Eckel
  3: // www.BruceEckel.com. See copyright notice in CopyRight.txt.
  4: public class ShowMessage {
  5:   private native void ShowMessage(String msg);
  6:   static {
  7:     System.loadLibrary("MsgImpl");
  8:     // Linux hack, if you can't get your library
  9:     // path set in your environment:
 10:     // System.load(
 11:     //  "/home/bruce/tij2/appendixb/MsgImpl.so");
 12:   }
 13:   public static void main(String[] args) {
 14:     ShowMessage app = new ShowMessage();
 15:     app.ShowMessage("Generated with JNI");
 16:   }
 17: } ///:~