title: java.lang.UnsatisfiedLinkError when using Maven imported libraries (Java3D)
body: <p>I've been trying to add some Java 3D dependency libraries in my Maven project, but I am getting an 'UnsatisfiedLinkError'. After some looking around, I think I'm seeing this error because java cannot find some required native libraries (.dll?) in java.libraries.home.</p>
  
  <p>I've seen solutions online about linking my machines PATH to the .dll files (and therefore adding them to my machines java.library.home), but I'm after a solution that will work on any mvn install.</p>
  
  <p>What's confusing me is that I'm using other Maven imported libraries (JGraphT), and they work fine.</p>
  
  <p>Does anyone know a way of automatically adding the native libraries on a maven install? If not, any other solutions to try?</p>
  
  <p>Thanks.</p>
  
  <p>In my pom.xml:</p>
  
  <pre><code>&lt;!-- language: lang-xml --&gt;    
  &lt;build&gt;
      &lt;defaultGoal&gt;clean install&lt;/defaultGoal&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;res&lt;/directory&gt;
              &lt;excludes&gt;
                  &lt;exclude&gt;**/*.java&lt;/exclude&gt;
              &lt;/excludes&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.7.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;single&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;archive&gt;
                      &lt;manifest&gt;
                          &lt;mainClass&gt;graphsim.Simulator&lt;/mainClass&gt;
                      &lt;/manifest&gt;
                  &lt;/archive&gt;
                  &lt;descriptorRefs&gt;
                      &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                  &lt;/descriptorRefs&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;dependencies&gt;
      &lt;!-- https://mvnrepository.com/artifact/java3d/j3d-core --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;java3d&lt;/groupId&gt;
          &lt;artifactId&gt;j3d-core&lt;/artifactId&gt;
          &lt;version&gt;1.3.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- https://mvnrepository.com/artifact/java3d/j3d-core-utils --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;java3d&lt;/groupId&gt;
          &lt;artifactId&gt;j3d-core-utils&lt;/artifactId&gt;
          &lt;version&gt;1.3.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- https://mvnrepository.com/artifact/java3d/vecmath --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;java3d&lt;/groupId&gt;
          &lt;artifactId&gt;vecmath&lt;/artifactId&gt;
          &lt;version&gt;1.3.1&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>Error message:</p>
  
  <pre>
      Exception in thread "main" java.lang.UnsatisfiedLinkError: no J3D in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
      at java.lang.Runtime.loadLibrary0(Runtime.java:870)
      at java.lang.System.loadLibrary(System.java:1122)
      at javax.media.j3d.MasterControl$22.run(MasterControl.java:889)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:886)
      at javax.media.j3d.VirtualUniverse.(VirtualUniverse.java:229)
      at javax.media.j3d.Canvas3D.(Canvas3D.java:3533)
      at gfx.point_viewer.PointFrame.(PointFrame.java:50)
      at gfx.GUIManager.createPointFrame(GUIManager.java:81)
      at gfx.GUIManager.(GUIManager.java:59)
      at graphsim.Simulator.start(Simulator.java:40)
      at graphsim.Simulator.main(Simulator.java:125)
  </pre>