libConsole/Console.java
author Markus Bröker<broeker.markus@googlemail.com>
Sun, 10 Feb 2019 13:17:01 +0100
changeset 173 374a86886bc5
parent 134 8325a0fc22cd
permissions -rw-r--r--
LAST-DIGIT-BUG: INCREMENT before LF

import java.io.File;

public class Console {
    public static native int getch ();
    private static void help () {
        String p = System.getProperty ("java.library.path");
        String[] msg = p.split (File.pathSeparator);
        System.err.printf ("Console Error:%n");

        for (int i = 0; i < msg.length; i++)
            System.err.printf ("\t%s%n", msg[i]);
        System.exit (-1);
    };

    static {
        try {
            System.loadLibrary ("Console");
        } catch (UnsatisfiedLinkError ule) {
            System.err.println (ule.getLocalizedMessage ());
            help ();
        }
    };
}