6

I want to try JNotify, the plugin library for watching file system changes, but cannot figure out how to configure it. The web page for JNotify says that "java.library.path should point to the location of the native libraries that comes with jnotify (dlls, so dylibs etc)". I am rather new to Mac OS X and don't really know how to do this. I'm using NetBeans and was hoping there was a simple way of adding it to the path in there. I tried it by simply adding the jar file to the Libraries node in the project, and importing it by "import net.contentobjects.jnotify.*;", but that didn't help. I'm getting this:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jnotify in java.library.path

It also seems I need to add native libraries (.so file for Mac I guess) into the same path.

So how do I do this?

4

2 に答える 2

1

java.library.pathは Java システム変数です。-Dプログラムの起動時にスイッチを使用して、この特定の変数を設定する必要があります。

java -Djava.library.path=/path/to/dylibs your.MainClass

プロジェクトのプロパティのどこかでプログラムを開始するときに、いくつかのコマンド ライン パラメータを追加するように Netbeans に指示できるはずです。

OS X では、必要なディレクトリは、.dylibファイルではなく、ファイルがある場所.soです。

于 2011-11-26T22:59:58.083 に答える
0

JNotify は MAC OSX 10.6.8 では機能しません。それと同じくらい簡単です。:( Linux では正常に動作します!何を試しても、変更されたファイルは正しく報告されません。

于 2012-03-25T02:53:40.673 に答える