A simple Java library(only one class now) which uses jni to call the functions in "ncurses.h".It can help you create a terminal program easily by Java.
-
ver 0.1.0
data:2016.10.07
update info:simplely achieve the frequently-used interface in 'ncurses.h' by jni.
-
ver 0.1.1
date:2016.10.10
update info:replace 'ncurses' to 'ncursesw' for Chinese support.
1.libncursesw5
$ sudo apt install libncursesw5
2.JDK
please ensure your jdk environment is right, or see the method from Google
1.be sure your Java environment is well
use$ java --version
to ensure you have right environment, so the Makefile can work normally.
If you don't have $(JAVA_HOME)
, the $ make
will fail also, please change the Maekfile in directory lib/
2.generate the library file
$ cd lib/
$ make
Then the libjncurses.so will be appeared in the directory lib/.
3.move libjncurses.so to "java.library.path"
you can copy the file to /usr/lib/
$ sudo cp ./libjncurses.so /usr/lib/
you can also make the directory lib/ one part of "java.library.path"
$ export LD_LIBRARY_PATH=$(JNCurses'dir)/lib
the first method will useful allways, and the second method will only useful in the terminal you use.
4.complie and run the test program
return the directory JNCurses/ and use $ make
or $ make test
to complie and run the test program.
1.please complete step 1/2/3 above.
2.return the directory JNCurses/ and copy the JNCurses.java to your java Program and you can use those interface to complete your program with JNCurses.
NOTE:Test.java will be helpful if you don't understand how the JNCurses works.