Я пытался добавить несколько библиотек зависимостей Java 3D в свой проект Maven, но я получаю 'UnsatisfiedLinkError'. После некоторого осмотра, я думаю, что вижу эту ошибку, потому что java не может найти некоторые необходимые собственные библиотеки (.dll?) В java.libraries.home.
Я видел решения в Интернете о связывании PATH моих машин с файлами .dll (и, следовательно, о добавлении их на мои машины java.library.home), но мне нужно решение, которое будет работать при любой установке mvn.
Меня смущает то, что я использую другие импортированные библиотеки Maven (JGraphT), и они работают нормально.
Кто-нибудь знает способ автоматического добавления нативных библиотек при установке maven? Если нет, то какие-нибудь другие решения попробовать?
Спасибо.
В моем pom.xml:
<!-- language: lang-xml -->
<build>
<defaultGoal>clean install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>res</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<mainClass>graphsim.Simulator</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/java3d/j3d-core -->
<dependency>
<groupId>java3d</groupId>
<artifactId>j3d-core</artifactId>
<version>1.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/java3d/j3d-core-utils -->
<dependency>
<groupId>java3d</groupId>
<artifactId>j3d-core-utils</artifactId>
<version>1.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/java3d/vecmath -->
<dependency>
<groupId>java3d</groupId>
<artifactId>vecmath</artifactId>
<version>1.3.1</version>
</dependency>
</dependencies>
Сообщение об ошибке:
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)