阅读更多
Mac OS X 下运行Java standalone 连接 Notes
Running Java standalone to connect to Notes on Mac OS X
Mac:
OS X 10.12.6
Notes:
Release 9.0.1 (64-bit) SHF861
Revision 20150916.0754-T00861SHF-EXT (Release 9.0.1 (64-bit) SHF861)
Standard Configuration
Java:
Oracle java version "1.8.0_151"
Eclipse IDE for Java Developers:
Version: Oxygen.1a Release (4.7.1a)
Build id: 20171005-1200
程序编译时,使用本地Notes下的Notes.jar, 于/Applications/IBM Notes.app/Contents/MacOS/jvm/lib/ext/Notes.jar
在Eclipse 中运行,可以直接选择Oracle JDK(是的,Notes运行在Java 8 下),Run Configuration, add
DYLD_LIBRARY_PATH=/Applications/IBMNotes.app/Contents/MacOS
在OS运行时,需要set env, 但由于Mac的SIP (System Integrity Protection), 你无法改变env的DYLD_LIBRARY_PATH 和 LD_LIBRARY_PATH. 此时,需要先关掉SIP.
1. Shutdown
2. Restart and hold Command-R 直到系统启动画面(进度条)出现
3. 从Utilities 选择 Terminal
4. csrtuil disable
5. Restart
此时,重启之后,SIP已经关掉,可以使用 csrutil status 查看。 进入Terminal, 打开.bash_profile, 再次设置env.
export DYLD_LIBRARY_PATH=/Applications/IBMNotes.app/Contents/MacOS
export LD_LIBRARY_PATH=/Applications/IBMNotes.app/Contents/MacOS
设置之后,重启Terminal,使用env 查看是否设置成功。 设置成功后,需要设置classpath. Mac 下,我将Notes.jar copy 到/Library/Java/Extensions/ 目录里使其对所有用户可见。
再次运行,问题解决。
原始问题issue:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lsxbe in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at lotus.domino.NotesThread.load(Unknown Source)
at lotus.domino.NotesThread.checkLoaded(Unknown Source)
at lotus.domino.NotesThread.sinitThread(Unknown Source)