ive ran into some trouble configuring java3D to work with my IDE environment...
I have downloaded j3d-1_5_2-linux-i586.zip, and unpacked j3dcore.jar, j3dutils.jar, v
Just try to this code, it's help me:
GraphicsConfiguration config =
SimpleUniverse.getPreferredConfiguration();
Canvas3D canvas3D = new Canvas3D(config);
I had this exact problem and the solution for me (I use eclipse) was to download the 32-bit (i586) (from https://java3d.java.net/binary-builds.html) archive and use those natives.
project/properties/java build path/source tab/expand and select native library location / navigate to i386 folder.
I know this question is now a few years old, but the answers here were not enough for me to solve the problem. They only helped partially. http://www.filsa.net/2008/07/17/eclipse-java3d-and-javalibrarypath/ was also a bit helpful, but it was still not enough. Therefore I felt obliged to write a complete checklist to have Java3D work in Eclipse.
A few months ago, I already had the same problem and I somehow solved it without really understanding what I did. Today I wanted to set up my environment on a different computer and guess what, I had the same problem again. And I forgot what I had to do... This time however, I solved the problem more systematically and now I understand every step.
The Solution - every step in detail
1) If you are importing someone else's project, make sure to have the correct JDK and JRE installed and selected in Eclipse. My Eclipse had selected the latest JRE 7. The only one I had installed. But the Project that I work on requires JDK 6 and JRE 6. I recommend the following structure on your file system if you need to have multiple java versions
2) In Eclipse, you will have to do the following steps to select the correct JDK and JRE.
3) Having your Java environment set up correctly, make sure that Java3D is installed on your machine. You can't do anything wrong with this.
4) In your Java3D installation directory, locate the files
It doesn't matter where these files are located if you setup your environment correctly, which I will explain. So if you want, you can copy these files into your project directory to have everything you need in one place.
5) Having located these files, make sure that
6) Now comes the part that saved my day today.
For each of the Java3D Libraries listed in the Java Build Path
you need to specify Native Library Location. The Native library is the j3dcore-ogl.dll, so edit the native library location to point to the directory containing j3dcore-ogl.dll.
I believe, that these are all steps that must be done to setup Java3D in eclipse, because I set up everything on a fresh computer today. Now I hope that these instructions will save some other poor Java-beginners', students' or programmers' day :-)
Java is complaining because it cannot find the native libraries (the *.so files) on your system path that Java3D comes with. Exactly how you fix this is up to you. You can do anyone one of the following:
1) Make sure that your system path includes the *.so files provided with Java3D
2) Setup your LD_LIBRARY_PATH environment variable: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/"path-to-java3d-libraries"/
3) Set the java.library.path when executing java: java -Djava.library.path=$LD_LIBRARY_PATH:/usr/lib/"path-to-java3d-libraries"/
To be sure you have things set correctly, add the following to your Java code and make sure the path reported contains the shared libraries on it
System.out.println("LD Library Path:" + System.getProperty("java.library.path"));
I had the same problem. Solved it setting the Native path:
Properties - java build path - libraties - java3Dlib - Native library location - External folder -----> find the path: ....Java/Java3D/1.5.1/bin or the path where is the file: j3dcore-ogl.dll