please include function jnativehook_init. import org.jnativehook.keyboard.NativeKeyEvent; static cached Map jNativeHook_keyCodes() { TreeMap map = new(new AlphanumComparator); new Matches m; for (S field : fieldNames(NativeKeyEvent.class)) if (startsWith(field, "VC_", m)) map.put(m.rest(), toInt(get(NativeKeyEvent, field))); ret map; }