Want more features on Pastebin? Sign Up, it's FREE!
Guest

How to include native library on maven's java.library.path variable

By: a guest on Apr 3rd, 2012  |  syntax: None  |  size: 1.95 KB  |  views: 240  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. java.lang.UnsatisfiedLinkError: no jnotify in java.library.path
  2.     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
  3.     at java.lang.Runtime.loadLibrary0(Runtime.java:823)
  4.     at java.lang.System.loadLibrary(System.java:1028)
  5.     at net.contentobjects.jnotify.linux.JNotify_linux.<clinit>(Unknown Source)
  6.     at net.contentobjects.jnotify.linux.JNotifyAdapterLinux.<init>(Unknown Source)
  7.     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  8.        
  9. <dependency>
  10.             <groupId>net.contentobjects</groupId>
  11.             <artifactId>jnotify</artifactId>
  12.             <version>0.93</version>
  13. </dependency>
  14. <dependency>
  15.            <groupId>net.contentobjects</groupId>
  16.            <artifactId>jnotify</artifactId>
  17.            <version>0.93</version>
  18.            <type>so</type>
  19. </dependency>
  20.  
  21.  
  22. <plugin>
  23.      <groupId>org.apache.maven.plugins</groupId>
  24.      <artifactId>maven-surefire-plugin</artifactId>
  25.      <configuration>
  26.             <argLine>-Djava.library.path=target/lib/</argLine>
  27.      </configuration>
  28. </plugin>
  29.  
  30. <plugin>
  31.      <groupId>org.apache.maven.plugins</groupId>
  32.      <artifactId>maven-dependency-plugin</artifactId>
  33.      <executions>
  34.        <execution>
  35.               <id>copy</id>
  36.               <phase>compile</phase>
  37.               <goals>
  38.                      <goal>copy</goal>
  39.               </goals>
  40.               <configuration>
  41.                     <artifactItems>
  42.                       <artifactItem>
  43.                              <groupId>net.contentobjects</groupId>
  44.                              <artifactId>jnotify</artifactId>
  45.                              <version>0.93</version>
  46.                              <type>so</type>
  47.                              <overWrite>true</overWrite>
  48.                       <outputDirectory>${project.build.directory}/lib</outputDirectory>
  49.                      </artifactItem>
  50.                      </artifactItems>
  51.                </configuration>
  52.              </execution>
  53.           </executions>
  54.  </plugin>
clone this paste RAW Paste Data