JNI console library, to provide native console access. This isn't meant to be an implementation of ncurses. It's just to give some common console control, like colors and cursor control. Under macOS and Linux, this does end up using ncurses.
.idea - idea project directory for C++ part of the project.
nconsole.iml is the IntelliJ Java project file.
No build for Windows yet. Planning to add that soon. Would like to use the native Windows console API.
Build a DLL in Windows:
cl -I\java\jdk1.8.0_45\include -I\java\jdk1.8.0_45\include\win32 -LD nconsole.cpp -Fenconsole.dll
Console programming on Windows
Build the shared library first, then the Java library you will use for other projects.
When building on Linux if you don't have cmake:
g++ -shared -o libnconsole.so -fPIC -I/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/include -I/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/include/linux -lncurses ncurses.cpp
When building on Linux with cmake:
cmake CMakeLists.txt
make
Quick test app to see things work, and test reading input and what the keystroke is mapped to.
java -cp out/production/nconsole -Djava.library.path=./cmake-build-debug com.axorion.NConsole $@
Then build the java lib, which results in nconsole.jar put in the current directory:
mkdir -p classes
javac -d classes src/java/com/axorion/NConsole.java
jar cvf nconsole.jar -C classes .