Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  JAVA3D Universe problem  (Read 361 times)
0 Members and 2 Guests are viewing this topic.
Offline lordberzerker97

JGO n00b
*

Posts: 34



« on: 2012-01-01 17:05:18 »

 Sorry to bother but i have a problem with my code. You see something is wrong with my Applet. Every time I try to run the code this error start to pop up in the console. Java3D is an API I am using for 3D graphics.

The error:
java.lang.UnsatisfiedLinkError: no j3dcore-ogl in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at javax.media.j3d.NativePipeline$1.run(NativePipeline.java:231)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.media.j3d.NativePipeline.loadLibrary(NativePipeline.java:200)
   at javax.media.j3d.NativePipeline.loadLibraries(NativePipeline.java:157)
   at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:987)
   at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:299)
   at javax.media.j3d.Canvas3D.<clinit>(Canvas3D.java:3881)
   at Code.MainGamePanel.<init>(MainGamePanel.java:14)
   at Code.MainWindow.<init>(MainWindow.java:Cool
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at java.lang.Class.newInstance0(Unknown Source)
   at java.lang.Class.newInstance(Unknown Source)
   at sun.applet.AppletPanel.createApplet(Unknown Source)
   at sun.applet.AppletPanel.runLoader(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)


MainWindow.java
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
package Code;

import java.applet.*;
import java.awt.*;

public class MainWindow extends Applet{
   private static final long serialVersionUID = 1L;
   MainGamePanel mgpanel = new MainGamePanel();
   private static int FWIDTH = 800;
   private static int FHEIGHT = 500;
   public void init(){
      setName("Dimensions");
      add(mgpanel);
      setSize(FWIDTH,FHEIGHT);
      setBackground(Color.white);
   }
   public void start(){}
   public void stop(){}
   public void destroy(){}
}


MainGamePanel.java This is where the problem is.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
package Code;

import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;
import javax.swing.*;
import java.awt.*;

public class MainGamePanel extends JPanel{
   private static final long serialVersionUID = 1L;
   SimpleUniverse universe;
   public MainGamePanel(){
      setLayout(new BorderLayout());
      Canvas3D canvas = new Canvas3D(universe.getPreferredConfiguration());
      add("Center",canvas);
      universe = new SimpleUniverse(canvas);
      BranchGroup scene = createSceneGraph();
      universe.getViewingPlatform().setNominalViewingTransform();
      scene.compile();
      universe.addBranchGraph(scene);
   }
   public BranchGroup createSceneGraph(){
      BranchGroup Bgroup = new BranchGroup();
      ColorCube cube = new ColorCube(0.5f);
      Bgroup.addChild(cube);
      return Bgroup;
   }
}
Online ra4king

JGO Kernel
*****

Posts: 3156
Medals: 196


I'm the King!


« Reply #1 on: 2012-01-01 17:34:29 »

That error has nothing to do with your code. You just didn't include the natives in the java.library.path correctly.

Also, Java3D is dead and I recommend that you abandon it too. There are many superior alternatives like Java Monkey Engine, jPCT, and Ardor3D.

Offline GabrielBailey74

Full Member
**

Posts: 157
Medals: 2


Owner of Elite Demons R.I.P


« Reply #2 on: 2012-04-05 19:45:41 »

I had the SAME exact problem less than a hour ago.

Make sure you've added all the 3 .jar files from the Java3D folder in : ("C:\Program Files\Java\Java3D\1.5.2\bin") ("j3dcore.jar", "j3dutils.jar", "vecmath.jar").

Not going to write out a little tutorial for that because it's all over the internet, but what they didn't say (And what I done was):

Go into "C:\Program Files\Java\Java3D\1.5.2\bin" or where ever that path is relative to your machines foldering system, and find the "j3dcore-ogl.dll" in that bin folder, and place it in with the 'jre#/bin' folder that you're IDE (Eclipse/Netbeans) is using as default, mine is "C:\Program Files\Java\jre6\bin".

Games published by our own members! Go get 'em!
Offline tom

JGO Neuromancer
****

Posts: 1113
Medals: 5



« Reply #3 on: 2012-04-05 20:10:58 »

NOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!

Never put java3d or any other library in the runtime. There will be conflicts when applications embed a different version of the library. Always embed. You have to set -Djava.library.path to point to a where your application has stored the files.

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.061 seconds with 19 queries.