Help me, I want to use native library in my Java Console Application . I want to load Linux Shared Library (file .so) . Can anyone know how to do?

Post has attachment
I have a big problem with Box2D (JBox2D 2.3.0) . I have taken 4 hours to debug but no success. My game sometimes goes wrong and I don't know why ?!

Here is my very basic console code written in Java (rewrite from Box2D manual):

/
* Problem 1: why the angle (radian) is not always 0 ?
* Problem 2: (sometimes seen) why the x coordinate (metter) is changed ?
* use JBox2D 2.3.0 SNAPSHOT
*/


import org.jbox2d.common.;
import org.jbox2d.dynamics.;
import org.jbox2d.collision.shapes.;

public class Main
{
public static void main(String[] args)
{
World world=new World(new Vec2(0, -10));

// create static ground
BodyDef bodyDef=new BodyDef();
bodyDef.position.set(0, -10);
Body ground=world.createBody(bodyDef);
PolygonShape shape=new PolygonShape();
shape.setAsBox(50, 10);
ground.createFixture(shape, 0);

// create falling box
bodyDef.type=BodyType.DYNAMIC;
bodyDef.position.set(0, 4);
Body fallBox=world.createBody(bodyDef);
shape.setAsBox(1, 1);
FixtureDef fixtureDef=new FixtureDef();
fixtureDef.shape=shape;
fixtureDef.density=1;
fixtureDef.friction=0.3f;
// fixtureDef.restitution=0.7f;
fallBox.createFixture(fixtureDef);

// simulating the World until all stops moving.
// frequency: 60 Hz
do
{
world.step(1/60f, 6, 2);
Vec2 p=fallBox.getPosition();
float angle=fallBox.getAngle();
System.out.printf("X %5.4f, Y %5.10f, RAD %5.10f\n", p.x, p.y, angle);
} while (fallBox.getLinearVelocity().y!=0);

System.out.println("DONE !");
}
}

Here is the result:

X 0,0000, Y 3,9972221851, RAD 0,0000000000

.......
.......

X 0,0000, Y 1,2500003576, RAD 0,0000000000
X 0,0000, Y 1,1250003576, RAD 0,0000000000
X 0,0000, Y 1,0145598650, RAD 0,0001292355
DONE !
Please help me ! (I am VIetnamese)
Photo

Post has attachment

Post has attachment

Post has attachment
My simulation of an insect with Box2D physics engine and AndEngine in Android. Take a look at the video clip https://www.youtube.com/watch?v=nEU57EQQ9-c

Post has attachment
Modeling a car in Android using Box2D physics and AndEngine. Take a look at the clip https://www.youtube.com/watch?v=DZwGUYXtR5Q

Post has attachment
My simulation of a Web Joint in Android using AndEngine and Box2D physics engine. Checkout the simulation at https://www.youtube.com/watch?v=Jm4fPSMsXdg

Post has attachment
Simulating a Web Joint using Box2D physics and AndEngine in Android. Take a look at the simulation https://www.youtube.com/watch?v=Jm4fPSMsXdg

Post has attachment

Post has attachment
Sliding and rolling friction. My post on simulating an Edge Shape in Android using Box2D physics engine and AndEngine. See the video clip of the simulation - https://www.youtube.com/watch?v=3hP79MKB-vU
Wait while more posts are being loaded