Q: Java exception "Could not load dll for system name OS X"

After not being able to find documentation on using AppleScript to access notes (there’s a single file of examples, but no dictionary and the AppleScript support seems to have all sorts of inconsistencies and errors), I decided I’d give trying to write a utility in Java. However, I’m stymied by some DLL issue (yes, there’s no such thing in OS X, and it ought not matter in Java anyway, yet that’s the error I get). Here’s my code:

package com.biib.ri.orgchart;

import lotus.domino.*;

public class NotesExport extends NotesThread {

public static void main(String[] args) {

	NotesExport exportThread = new NotesExport();

	exportThread.start();

}



public void runNotes() {

	try {

		Session notesSession = NotesFactory.createSession();

		String platform = notesSession.getPlatform();

		System.out.println("It worked!\nPlatform = " + platform);

	} catch (Exception e) {

		e.printStackTrace();

	}

}

}

And here’s the stack trace I get when I run it:

NotesException: Could not load dll for system name Mac OS X

at lotus.domino.NotesThread.load(NotesThread.java:294)

at lotus.domino.NotesThread.checkLoaded(NotesThread.java:320)

at lotus.domino.NotesThread.initThread(NotesThread.java:147)

at lotus.domino.NotesThread.run(NotesThread.java:205)

Exception in thread “Thread-0” java.lang.UnsatisfiedLinkError: NnotesInitThread

at lotus.domino.NotesThread.NnotesInitThread(Native Method)

at lotus.domino.NotesThread.initThread(NotesThread.java:153)

at lotus.domino.NotesThread.run(NotesThread.java:205)

… I’ve added the Notes client directory to DYLD_LIBRARY_PATH and LD_LIBRARY_PATH in case the jar needed something in there (lots of old-style PowerPC PEF executable/libraries there), but that had no effect.

Any ideas?

Subject: Q: Java exception “Could not load dll for system name OS X”

It might have something to do with Notes 6.5.* not supporting Java on Mac OS X. Since you’re calling Notes backend class methods from Java, the backend class mechanism might not be prepared for JNI calls into it and may be trying to access the JVM, etc.