Glk for Java

Documentation contents

Introduction

This is a Java binding for Andrew Plotkin's Glk interface. It is not in itself a full implementation of Glk; rather, it uses JNI (Java Native Interface) to piggyback on an existing Glk implementation (currently xglk).

If you're writing a Glk program in Java, then all you have to do (assuming jniglk is installed) is:

  1. Install jniglk.
  2. Import any classes you need from org.ifarchive.glk.
  3. Add a static public void glkMain(void) method in one of your classes. Glk will call this instead of your usual main() function.
  4. Run that class using jniglk instead of java. For example, to run the supplied "Model" program, use:
    	jniglk Model
    

Known bugs


John Elliott, 1 January 2002.