I have written a starter guide of how to use jme and jmephysics with netBeans v4.1. I hope this will help people to come over the first problems when using netBeans. If something don't work, you find errors or you know how to make things better, please let me know. To get the cvs access for jme you need a java.net registration, which you can get at java.net.
In this guide i have used some dummies, which you should replace with the correct paths. Here the explanation for what they stand for:
MY_PATH_TO_JME_CVS : replace it with the location where you want the cvs version of jme
MY_PATH_TO_JME_PHYSICS_CVS : replace it with the location where you want the cvs version of jmephysics
MY_PATH_TO_JME_PHYSICS_OK : replace it with the location where you want the real version of jmephysics
There are 7 sections:
a) How to setup netBeans-cvs for jme
b) How to setup netBeans-cvs for jmephysics
c) How to compile the cvs version of jme
d) How to compile the cvs version of jmephysics
e) How to compile and run your own jme-application
f) How to compile and run your own jmephysics-application
g) Note
Maybe when you read this the names of some files might have changed (for example jogg-0.0.5 could go to jogg-0.0.6), so if something will not start correctly, please check the "VM OPTIONS" for those possible changes. Thank you.
a) How to setup netBeans-cvs for jme:
- go to the menue-bar: Versioning -> Versioning Manager
- press >Add…<
- set:
VERSION CONTROL SYSTEM PROFILE: CVS
WORKING DIRECTORY: MY_PATH_TO_JME_CVS
CVS SERVER TYPE: pserver
CVS SERVER NAME: cvs.dev.java.net
PORT: 2401
USER NAME: (enter your java.net user name here)
REPOSITORY PATH: /cvs
(x) to >USE BUILD-IN CVS CLIENT<
PASSWORD: (enter your password for your java.net user name here)
( ) to >SET OFFLINE MODE<
(x) to >PERFORM CHECKOUT<
- press >Next<
- press >Module(s):< and enter "jme"
- press >Finish<
- press >Close<
8 ) now netBeans should start updating to the cvs-jme version
To start a new update:
- go to the menue-bar: Window -> Versioning -> Versioning
- doubleclick on the correct CVS line
- rightclick on >jme<: CVS -> Update
b) How to setup netBeans-cvs for jmephysics:
- go to the menue-bar: Versioning -> Versioning Manager
- press >Add…<
- set:
VERSION CONTROL SYSTEM PROFILE: CVS
WORKING DIRECTORY: MY_PATH_TO_JME_PHYSICS_CVS
CVS SERVER TYPE: pserver
CVS SERVER NAME: cvs.sourceforge.net
PORT: 2401
USER NAME: anonymous
REPOSITORY PATH: /cvsroot/jme-physics
(x) to >USE BUILD-IN CVS CLIENT<
PASSWORD: (no password here)
( ) to >SET OFFLINE MODE<
(x) to >PERFORM CHECKOUT<
- press >Next<
- (x) to >ALL<
- press >Finish<
- press >Close<
8 ) now netBeans should start updating to the cvs-jmephysics version
To start a new update:
- go to the menue-bar: Window -> Versioning -> Versioning
- doubleclick on the correct CVS line
- rightclick on >jmephysics<: CVS -> Update
- rightclick on >jme-physics-editor<: CVS -> Update
c) How to compile the cvs version of jme:
- go to the menue-bar: File -> New Project…
- choose >General< and >Java Project with Existing Ant Script<
- press >Next<
- set LOCATION: MY_PATH_TO_JME_CVS/jme (for Linux) and MY_PATH_TO_JME_CVSjme (Windows)
- press >Next<
- press >Next<
- press >Add Folder…< for >SOURCE PACKAGE FOLDERS< and choose: src
8 ) press >Finish<
- go to menue-bar: Windows -> Projects
- rightclick on jME: Clean and Build Project
- rightclick on jME: Test Project
- rightclick on jME: Generate Javadoc for Project
(the error output is ok, the last line should be "BUILD SUCCESSFULL…")
- rightclick on jME: Close Project
To compile again after a cvs-update:
- go to menue-bar: Open Project
- choose the correct project
- do steps 9) to 13)
To start the tests:
- go to a console (Linux) or dos-box (Windows)
- "cd MY_PATH_TO_JME_CVS/jme/build/" (Linux) or "cd MY_PATH_TO_JME_CVSjmebuild" (Windows)
-
under Linux enter: "java -Djava.library.path=MY_PATH_TO_JME_CVS/jme/lib -cp MY_PATH_TO_JME_CVS/jme/lib/lwjgl.jar:MY_PATH_TO_JME_CVS/jme/lib/jogg-0.0.5.jar:MY_PATH_TO_JME_CVS/jme/lib/jorbis-0.0.12.jar:. jmetest/TestChooser"
under Windows enter: "java -Djava.library.path=MY_PATH_TO_JME_CVSjmelib -cp MY_PATH_TO_JME_CVSjmeliblwjgl.jar;MY_PATH_TO_JME_CVSjmelibjogg-0.0.5.jar;MY_PATH_TO_JME_CVSjmelibjorbis-0.0.12.jar;. jmetestTestChooser"
d) How to compile the cvs version of jmephysics:
- go to the menue-bar: File -> New Project…
- choose >General< and >Java Application<
- press >Next<
- set PROJECT NAME: jmephysics-ok
- set PROJECT LOCATION: MY_PATH_TO_JME_PHYSICS_OK
- ( ) to >SET AS MAIN PROJECT<
- ( ) to >CREATE MAIN CLASS<
8 ) press >Finish<
- go to menue-bar: Windows -> Projects
- rightclick on jmephysics-ok: Close Project
- delete the directory: MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/src
- copy the directories "lib" and "src" from MY_PATH_TO_JME_PHYSICS_CVS/jmephysics to MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok
- in MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/lib delete all except: jmetest-data.jar, junit.jar, libodejava.jnilib, libodejava.so, odejava.dll
- go to menue-bar: Open Project
- choose: jmephysics-ok
- go to menue-bar: Windows -> Projects
- rightclick on jmephysics-ok: Properties
- go to category >Libraries<
- press >Add JAR/Folder< and add all jar-files of: MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/lib
- press >Add JAR/Folder< and add the directory: MY_PATH_TO_JME_CVS/jme/build
- press >Add JAR/Folder< and add all jar-files of: MY_PATH_TO_JME_CVS/jme/lib
- go to category >Run<
- set VM OPTIONS:
under Linux: "-Djava.library.path=MY_PATH_TO_JME_CVS/jme/lib:MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/lib -cp MY_PATH_TO_JME_CVS/jme/lib/lwjgl.jar:MY_PATH_TO_JME_CVS/jme/lib/jogg-0.0.5.jar:MY_PATH_TO_JME_CVS/jme/lib/jorbis-0.0.12.jar:MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/lib/jmetest-data.jar:MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/lib/junit.jar"
under Windows: "-Djava.library.path=MY_PATH_TO_JME_CVSjmelib;MY_PATH_TO_JME_PHYSICS_OKjmephysics-oklib -cp MY_PATH_TO_JME_CVSjmeliblwjgl.jar;MY_PATH_TO_JME_CVSjmelibjogg-0.0.5.jar;MY_PATH_TO_JME_CVSjmelibjorbis-0.0.12.jar;MY_PATH_TO_JME_PHYSICS_OKjmephysics-oklibjmetest-data.jar;MY_PATH_TO_JME_PHYSICS_OKjmephysics-oklibjunit.jar"
- press >Ok<
- rightclick on jmephysics-ok: Clean and Build Project
- rightclick on jmephysics-ok: Generate Javadoc for Project
(the error output is ok, the last line should be "BUILD SUCCESSFULL…")
- rightclick on jmephysics-ok: Close Project
To compile again after a cvs-update:
- delete the directory: MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/lib
- do steps 11) to 16) and 25) to 27)
To start the tests:
- go to menue-bar: Open Project
- choose: jmephysics-ok
- go to menue-bar: Windows -> Projects
- doubleclick on: jmephysics-ok
- doubleclick on: Source Packages
- doubleclick on: jmextest.physics
- rightclick on SimpleTest.java -> Run File
e) How to compile and run your own jme-application:
- go to the menue-bar: File -> New Project…
- choose >General< and >Java Application<
- press >Next<
- set PROJECT NAME: my-own-jme-application
- set PROJECT LOCATION: (set the location you want)
- (x) to >SET AS MAIN PROJECT<
- (x) to >CREATE MAIN CLASS<
8 ) press >Finish<
- go to menue-bar: Windows -> Projects
- rightclick on my-own-jme-application: Properties
- go to category >Libraries<
- press >Add JAR/Folder< and add the directory: MY_PATH_TO_JME_CVS/jme/build
- press >Add JAR/Folder< and add all jar-files of: MY_PATH_TO_JME_CVS/jme/lib
- go to category >Run<
- set VM OPTIONS:
under Linux: "-Djava.library.path=MY_PATH_TO_JME_CVS/jme/lib -cp MY_PATH_TO_JME_CVS/jme/lib/lwjgl.jar:MY_PATH_TO_JME_CVS/jme/lib/jogg-0.0.5.jar:MY_PATH_TO_JME_CVS/jme/lib/jorbis-0.0.12.jar"
under Windows: "-Djava.library.path=MY_PATH_TO_JME_CVSjmelib -cp MY_PATH_TO_JME_CVSjmeliblwjgl.jar;MY_PATH_TO_JME_CVSjmelibjogg-0.0.5.jar;MY_PATH_TO_JME_CVSjmelibjorbis-0.0.12.jar"
- press >Ok<
- for an example delete the whole source code (except the line "package…") from Main.java which you should see in the Document Window (menue-bar: Window -> Switch to Document)
- now copy the source of: MY_PATH_TO_JME_CVS/jme/src/jmetest/TutorialGuide/HelloWorld.java (except the line "package…") into Main.java
- rename in Main.java all "HelloWorld" to "Main"
- rightclick on my-own-jme-application: Clean and Build Project
- rightclick on my-own-jme-application: Run Project
f) How to compile and run your own jmephysics-application:
- go to the menue-bar: File -> New Project…
- choose >General< and >Java Application<
- press >Next<
- set PROJECT NAME: my-own-jmephysics-application
- set PROJECT LOCATION: (set the location you want)
- (x) to >SET AS MAIN PROJECT<
- (x) to >CREATE MAIN CLASS<
8 ) press >Finish<
- go to menue-bar: Windows -> Projects
- rightclick my-own-jmephysics-application: Properties
- go to category >Libraries<
- press >Add JAR/Folder< and add the directory: MY_PATH_TO_JME_CVS/jme/build
- press >Add JAR/Folder< and add all jar-files of: MY_PATH_TO_JME_CVS/jme/lib
- press >Add JAR/Folder< and add the directory: MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/build/classes
- go to category >Run<
- set VM OPTIONS:
under Linux: "-Djava.library.path=MY_PATH_TO_JME_CVS/jme/lib:MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/lib -cp MY_PATH_TO_JME_CVS/jme/lib/lwjgl.jar:MY_PATH_TO_JME_CVS/jme/lib/jogg-0.0.5.jar:MY_PATH_TO_JME_CVS/jme/lib/jorbis-0.0.12.jar"
under Windows: "-Djava.library.path=MY_PATH_TO_JME_CVSjmelib;MY_PATH_TO_JME_PHYSICS_OKjmephysics-oklib -cp MY_PATH_TO_JME_CVSjmeliblwjgl.jar;MY_PATH_TO_JME_CVSjmelibjogg-0.0.5.jar;MY_PATH_TO_JME_CVSjmelibjorbis-0.0.12.jar"
- press >Ok<
- for an example delete the whole source code (except the line "package…") from Main.java which you should see in the Document Window (menue-bar: Window -> Switch to Document)
- now copy the source of: MY_PATH_TO_JME_PHYSICS_OK/jme-physics-ok/src/jmextest/physics/SimpleTest.java (except the line "package…") into Main.java
- rename in Main.java all "SimpleTest" to "Main"
- rightclick on my-own-jmephysics-application: Clean and Build Project
- rightclick on my-own-jmephysics-application: Run Project
g) Note:
Since jME has its own ant build script, it must be a netBeans free-form IDE project. As a reason of this i don't know how to add the sources of jME in step e) and f), so that you can't rightclick on for example setDialogBehaviour (-> Go To -> Source) to jump to the source-code. As an impure solution for this you can do the following steps. If someone knows a better way, please let me know:
- go to menue-bar: Tools -> Java Platform Manager
- press on "Sources"
- press >Add JAR/Folder…<
- choose: MY_PATH_TO_JME_CVS/jme/src
- press >Close<