2016-09-13 4 views
1

Ich versuche, eine HelloWord Java-Anwendung auszuführen, die auf den Notes-Client auf einem Mac zugreift. Ich hatte das an älteren Versionen arbeiten. Derzeit habe ich Java 1.8.0_101-b13 ein OS/X 10.11.6. Ich versuche, diesen Code auszuführen:Das Ausführen einer IBM Notes-Java-Anwendung unter OS X El Capitan löst UnbefriedigendLinkError

import lotus.domino.NotesException; 
import lotus.domino.NotesFactory; 
import lotus.domino.NotesThread; 
import lotus.domino.Session; 

public class HelloWorld { 

    public static void main(String[] args) throws NotesException { 
    HelloWorld hw = new HelloWorld(); 
    hw.sayHello(); 
    } 

    private void sayHello() throws NotesException { 
    System.out.println("java.library.path: "+ System.getProperty("java.library.path")); 
    System.out.println("PATH: "+ System.getenv("PATH")); 
    NotesThread.sinitThread(); 
    Session s = NotesFactory.createSession(); 
    System.out.println(s.getEffectiveUserName()); 
    NotesThread.stermThread(); 
    } 
} 

I LD_LIBRARY_PATH=/Applications/IBM Notes.app in einer Eclipse-Run-Konfiguration festgelegt haben. Wenn ich die App starte, bekomme ich:

java.library.path: /Applications/IBM Notes.app:/Users/joe/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:. PATH: /Applications/IBM Notes.app:/usr/bin:/bin:/usr/sbin:/sbin Exception in thread "main" java.lang.UnsatisfiedLinkError: no lsxbe in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864) 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) at com.notessensei.HelloWorld.sayHello(HelloWorld.java:31) at com.notessensei.HelloWorld.main(HelloWorld.java:20)

Der Bibliothekspfad sieht OK aus. Ich muss etwas Offensichtliches vermissen?

aktualisieren: Wenn Sie am Ausgang sucht, nimmt Java auf die LD_LIBRARY_PATH Variable, so DYLD_LIBRARY_PATH scheint nicht werden musste (es Ich habe ohne Erfolg zu testen). DYLD ... scheint be problematic auf OS/X. Ein Gedanke, der nicht klar ist: In der OS/X-Welt zeigen Sie normalerweise auf die App (IBM Notes.app), aber der Inhalt ist tatsächlich in appname.app/Contents/MacOS. Ich denke, ich habe beides mit dem gleichen Ergebnis versucht. Ist der Platz im Pfad hoch?

Update 2: Da die Ausgabe von otool -L liblsxbe.dylib angefordert

liblsxbe.dylib: @executable_path/liblsxbe.dylib (compatibility version 0.0.0, current version 0.0.0) @executable_path/libxmlproc.dylib (compatibility version 0.0.0, current version 0.0.0) @executable_path/libnotes.dylib (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 157.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

otool -L libxmlproc.dylib

libxmlproc.dylib: @executable_path/libxmlproc.dylib (compatibility version 0.0.0, current version 0.0.0) @executable_path/libnotes.dylib (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 157.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

`otool -L libnotes.dylib‘

libnotes.dylib: @executable_path/libnotes.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0) @executable_path/libjsmac.dylib (compatibility version 0.0.0, current version 0.0.0) @executable_path/libndgts.dylib (compatibility version 0.0.0, current version 0.0.0) @executable_path/libxmlproc.dylib (compatibility version 0.0.0, current version 0.0.0) @executable_path/libgsk8iccs.dylib (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 55471.14.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 20.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 157.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.14.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1265.19.0) /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork (compatibility version 1.0.0, current version 673.2.1) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 48.0.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 59.0.0)

Was sonst noch?

+0

Es ist 'DYLD_LIBRARY_PATH' auf Mac OS X – user2543253

+0

@ user2543253 nicht mehr: https://github.com/souymith/cudnn.torch/issues/111 auf El Captain blockiert. Und ich habe das auch eingestellt - Änderung der Frage – stwissel

+0

Ah, gut zu wissen, danke. Aber befindet sich die Lib tatsächlich in '/ Applications/IBM Notes.app'? Ich würde lieber '/ Anwendungen/IBM Notes.app/Contents/MacOSX' erwarten. – user2543253

Antwort

0

Nach viel Sondierung stellte sich heraus, dass 2 Probleme zu lösen waren. Die erste ist in einer post by Mikkel Flint Heisterberg beschrieben. Neben DYLD_LIBRARY_PATH muss eine weitere Umgebungsvariable gesetzt werden: NOTESBIN. Beide zeigen auf den gleichen Ort:

DYLD_LIBRARY_PATH=/Applications/IBM Notes.app/Contents/MacOS 
NOTESBIN=/Applications/IBM Notes.app/Contents/MacOS 

In der Eclipse-Laufkonfiguration sind keine Anführungszeichen oder Backslashes erforderlich.

Der zweite war kniffliger. Aus Bequemlichkeit, da es vorher funktionierte, hatte ich einen neuen Eintrag "installierte JVM" namens "Notes9" erstellt. Dort zeigte ich auf die Oracle JVM8 (yep, auf Mac Notes läuft Java8) und die Notes.jar (und die anderen) in jvm/lib/ext des Notes Programmverzeichnisses.

Mac mag das nicht mehr (mehr). Sobald ich auf eine "nackte" JVM8 zeigte und Notes.jar als externe Jar-Abhängigkeit hinzufügte, funktionierte alles wie erwartet.

Verwandte Themen