我用过Jnotify在 window 中。我复制了SYSTEM文件夹和SYSTEM32中的DLL文件 并将 Jnotify.jar 包含在构建路径中。这个程序运行良好。我得到了 jnoitify 提供的 Windows 系统中的所有通知。
现在我希望 jnotify 在 Ubunt Linux 中工作。请帮助我我应该遵循什么程序。我将 Jnoitify.jar 包含在我的 java 类路径中。但它不起作用。
按照上述操作,会出现以下异常。
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at net.contentobjects.jnotify.linux.JNotify_linux.<clinit>(Unknown Source)
at net.contentobjects.jnotify.linux.JNotifyAdapterLinux.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at net.contentobjects.jnotify.JNotify.<clinit>(Unknown Source)
at test.test2.NotifyHandler.sample(NotifyHandler.java:23)
at test.test2.NotifyHandler.main(NotifyHandler.java:42)
最佳答案
通过设置本地库的路径,我能够在Linux中配置和运行jnotify
关于java - 如何在Linux(Ubuntu操作系统)中配置Jnotify?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7726426/