I have been trying to get java-readline compiled on mac os, and there were references to a blog entry on it, but the entry is now gone. I found it on archive.org, and here are the instructions I used to get it running:
Using darwinports, do:
port install readlineIn the source root, edit
Makefile and make the following changes:- Add
JAVA_HOME = /Library/Java/Homebelow the line# Operating system dependent - Make the
JAVANATINCvariable read$(JAVA_HOME)/include - Change
LD_LIBRARY_PATHto beDYLD_LIBRARY_PATH
Now, edit
src/native/Makefile and change the following:- Add
-I/opt/local/includeto the end of theINCLUDESvariable. - Change the
LIBPATHvariable to be-L/opt/local/lib - Change the
CFLAGSvariable to-fno-common - Change
$(CC) -shared $(OBJECTS) $(LIBPATH) $($(TG)_LIBS) -o $@to$(CC) -bundle -flat_namespace $(OBJECTS) $(LIBPATH) $($(TG)_LIBS) -o $@
You should now be able to run
make and get libJavaReadline.so and libreadline-java.jar. You'll need to rename libJavaReadline.so to libJavaReadline.jnilib. I put both of these in
/Library/Java/Extensions, which makes the library available to all Java processes that are started as you. Make sure everything works by running java test.ReadlineTest from the command line.

0 comments:
Post a Comment