This is a starter guide that shows 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:
There are eight 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
h) Link to the official netBeans docs
Maybe when you read this the names of some files might have changed (for example jogg-0.0.7 could go to jogg-0.0.8), 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 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<
now netBeans should start updating to the cvs-jME version
To start a new 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 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<
now netBeans should start updating to the cvs-jMEphysics version
To start a new 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:
under Linux: MY_PATH_TO_JME_
CVS/jme
under Windows: MY_PATH_TO_JME_
CVS\jme
press >Next<
press >Next<
press >Add Folder…< for >SOURCE PACKAGE FOLDERS< and choose: src
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:
To start the tests:
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<
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.7.jar:MY_PATH_TO_JME_
CVS/jme/lib/jorbis-0.0.15.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_
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.7.jar;MY_PATH_TO_JME_
CVS\jme\lib\jorbis-0.0.15.jar;MY_PATH_TO_JME_PHYSICS_OK\jmephysics-ok\lib\jmetest-data.jar;MY_PATH_TO_JME_PHYSICS_OK\jmephysics-ok\lib\junit.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:
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<
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.7.jar:MY_PATH_TO_JME_
CVS/jme/lib/jorbis-0.0.15.jar
under Windows: -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.7.jar;MY_PATH_TO_JME_
CVS\jme\lib\jorbis-0.0.15.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<
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.7.jar:MY_PATH_TO_JME_
CVS/jme/lib/jorbis-0.0.15.jar
under Windows: -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.7.jar;MY_PATH_TO_JME_
CVS\jme\lib\jorbis-0.0.15.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<
— Kay Gergs (justin) 2005/09/30 06:49
h) Link to the official docs
If this manual doesn't mention Your problem then You may want to take a look at:
http://www.netbeans.org/kb/41/index.html - for general docs on the famous netBeans 4.1 IDE
http://www.netbeans.org/kb/50/index.html - for general docs on the (even more) famous netBeans 5.0 IDE
http://www.netbeans.org/kb/41/freeform-config.html - for customization of netBeans 4.1 / 5.0 free-form projects (eg. compile, debug and run single files / jME-tests from a context menue within netBeans)
— winkman 2006/04/20 10:10
i) Comment on libraries in f
This is how you can get access to the source and javadoc of added libraries.
Instead of:
13: press >Add JAR/Folder< and add the directory: MY_PATH_TO_JME_
CVS/jme/build
Do this:
— Per Rosengren 2006/02/23 02:36