jME with Eclipse in 2 minutes


Getting Up and Running with jME and Eclipse in 2 minutes -

1)Get Sun Java JRE , preferably 1.6 beta , its really really fast than 1.5 . Size is 15 MB. Install .

2)Get Eclipse . 3.1 or 3.2 , both are nice . Extract and it is installed .

3)Get jME Nightly build ( not source ) . Extract somewhere in a directory .

4)Copy all files in the directory to C:Program FilesJavajre1.6.0libext . Then copy all files in the "lib"
  directory to C:Program FilesJavajre1.6.0libext

5)Open Eclipse . Create New Java Project . Add new class "myprogram" to the project and paste following code into it.

import com.jme.app.SimpleGame;
import com.jme.scene.shape.Box;
import com.jme.scene.shape.Sphere;
import com.jme.math.Vector3f;

public class myprogram extends SimpleGame{
public static void main(String[] args) {
myprogram app = new myprogram();
app.setDialogBehaviour(SimpleGame.ALWAYS_SHOW_PROPS_DIALOG);
app.start();
}
protected void simpleInitGame(){
Box b1;
Sphere s1;
Vector3f v1 = new Vector3f(1,1,1);
Vector3f v2 = new Vector3f(5,5,15);
Vector3f v3 = new Vector3f(-3,1,1);
b1 = new Box("box", v1, v2);
s1 = new Sphere("sphere", v3, 20, 20, 3);
rootNode.attachChild(b1);
rootNode.attachChild(s1);
}
}

Right Click on myprogram.java -> RunAs -> JavaApplication.

I Hope it made some sense !!!

I'm not an eclipse user but this seems to be a compact getting started for eclipse. Good work :slight_smile: (afai can see)

Maybe it should be added to the wiki? And a link to it put on the getting started article?



edit: uh, actually I skipped that copying to ext :frowning: but it could read "add all those to your project classpath"

there might be problems later because of copying those files into the ext directory.

it's really the fastest way to get it working, but not the cleanest. there would be problems later specially if there will be another lwjgl version for jme and/or another jme version. i don't know how webstart applications would react.  :expressionless:

oh, in deed - that should be changed to adding it to native library path

Ofcourse , its really quick and dirty way to get going .

Otherwise normally you would have have to add "lib" directory to project path in eclipse and also jme.jar & others to classpath . But thats a headache if you are just beginning .

Are You sure You need a JRE and not a JDK ?

a jdk is recommendable but not needed to develop with eclipse.

Basically ,



Sun Java JDK = Sun Java Compiler + Sun Java JRE



But , Eclipse already has a Java Compiler from IBM , but no JRE.



So you really just need the JRE .  :wink:





Secondly , I included everything in jre/lib/ext because JRE (only) is by default included in the Build Path of an "Eclipse Project" . So to

save time every time setting paths when starting a Project .