Setting up netBeans to build jME

OBSOLETE PLEASE SEE [[new_frontpage]] for jME 2 Tutorials

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:

  • 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 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

  1. go to the menue-bar: Versioning → Versioning Manager
  2. press >Add…<
  3. 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<
  4. press >Next<
  5. press >Module(s):< and enter “jme”
  6. press >Finish<
  7. 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

  1. go to the menue-bar: Versioning → Versioning Manager
  2. press >Add…<
  3. 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<
  4. press >Next<
  5. (x) to >ALL<
  6. press >Finish<
  7. 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

  1. go to the menue-bar: File → New Project…
  2. choose >General< and >Java Project with Existing Ant Script<
  3. press >Next<
  4. set LOCATION:
    • under Linux: MY_PATH_TO_JME_CVS/jme
    • under Windows: MY_PATH_TO_JME_CVS\jme
  5. press >Next<
  6. press >Next<
  7. press >Add Folder…< for >SOURCE PACKAGE FOLDERS< and choose: src
  8. press >Finish<
  9. go to menue-bar: Windows → Projects
  10. rightclick on jME: Clean and Build Project
  11. rightclick on jME: Test Project
  12. rightclick on jME: Generate Javadoc for Project (the error output is ok, the last line should be “BUILD SUCCESSFULL…”)
  13. 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)
  • enter:
    • under Linux: cd MY_PATH_TO_JME_CVS/jme/build/
    • under Windows: cd MY_PATH_TO_JME_CVS\jme\build
  • enter:
    • under Linux: 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.7.jar:MY_PATH_TO_JME_CVS/jme/lib/jinput.jar:MY_PATH_TO_JME_CVS/jme/lib/jorbis-0.0.15.jar:. jmetest/TestChooser
    • under Windows: 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.7.jar;MY_PATH_TO_JME_CVS/jme/lib/jinput.jar;MY_PATH_TO_JME_CVS\jme\lib\jorbis-0.0.15.jar;. jmetest\TestChooser




d) How to compile the cvs version of jMEphysics

  1. go to the menue-bar: File → New Project…
  2. choose >General< and >Java Application<
  3. press >Next<
  4. set PROJECT NAME: jmephysics-ok
  5. set PROJECT LOCATION: MY_PATH_TO_JME_PHYSICS_OK
  6. ( ) to >SET AS MAIN PROJECT<
  7. ( ) to >CREATE MAIN CLASS<
  8. press >Finish<
  9. go to menue-bar: Windows → Projects
  10. rightclick on jmephysics-ok: Close Project
  11. delete the directory: MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/src
  12. copy the directories “lib” and “src” from MY_PATH_TO_JME_PHYSICS_CVS/jmephysics to MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok
  13. in MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/lib delete all except: jmetest-data.jar, junit.jar, libodejava.jnilib, libodejava.so, odejava.dll
  14. go to menue-bar: Open Project
  15. choose: jmephysics-ok
  16. go to menue-bar: Windows → Projects
  17. rightclick on jmephysics-ok: Properties
  18. go to category >Libraries<
  19. press >Add JAR/Folder< and add all jar-files of: MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/lib
  20. press >Add JAR/Folder< and add the directory: MY_PATH_TO_JME_CVS/jme/build
  21. press >Add JAR/Folder< and add all jar-files of: MY_PATH_TO_JME_CVS/jme/lib
  22. go to category >Run<
  23. 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
  24. press >Ok<
  25. rightclick on jmephysics-ok: Clean and Build Project
  26. rightclick on jmephysics-ok: Generate Javadoc for Project (the error output is ok, the last line should be “BUILD SUCCESSFULL…”)
  27. 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

  1. go to the menue-bar: File → New Project…
  2. choose >General< and >Java Application<
  3. press >Next<
  4. set PROJECT NAME: my-own-jme-application
  5. set PROJECT LOCATION: (set the location you want)
  6. (x) to >SET AS MAIN PROJECT<
  7. (x) to >CREATE MAIN CLASS<
  8. press >Finish<
  9. go to menue-bar: Windows → Projects
  10. rightclick on my-own-jme-application: Properties
  11. go to category >Libraries<
  12. press >Add JAR/Folder< and add the directory: MY_PATH_TO_JME_CVS/jme/build
  13. press >Add JAR/Folder< and add all jar-files of: MY_PATH_TO_JME_CVS/jme/lib
  14. go to category >Run<
  15. 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
  16. press >Ok<
  17. 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)
  18. now copy the source of: MY_PATH_TO_JME_CVS/jme/src/jmetest/TutorialGuide/HelloWorld.java (except the line “package…”) into Main.java
  19. rename in Main.java all “HelloWorld” to “Main”
  20. rightclick on my-own-jme-application: Clean and Build Project
  21. rightclick on my-own-jme-application: Run Project




f) How to compile and run your own jMEphysics-application

  1. go to the menue-bar: File → New Project…
  2. choose >General< and >Java Application<
  3. press >Next<
  4. set PROJECT NAME: my-own-jmephysics-application
  5. set PROJECT LOCATION: (set the location you want)
  6. (x) to >SET AS MAIN PROJECT<
  7. (x) to >CREATE MAIN CLASS<
  8. press >Finish<
  9. go to menue-bar: Windows → Projects
  10. rightclick my-own-jmephysics-application: Properties
  11. go to category >Libraries<
  12. press >Add JAR/Folder< and add the directory: MY_PATH_TO_JME_CVS/jme/build
  13. press >Add JAR/Folder< and add all jar-files of: MY_PATH_TO_JME_CVS/jme/lib
  14. press >Add JAR/Folder< and add the directory: MY_PATH_TO_JME_PHYSICS_OK/jmephysics-ok/build/classes
  15. go to category >Run<
  16. 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
  17. press >Ok<
  18. 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)
  19. 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
  20. rename in Main.java all “SimpleTest” to “Main”
  21. rightclick on my-own-jmephysics-application: Clean and Build Project
  22. 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:

  1. go to menue-bar: Tools → Java Platform Manager
  2. press on “Sources”
  3. press >Add JAR/Folder…<
  4. choose: MY_PATH_TO_JME_CVS/jme/src
  5. 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:

  • press >Add Library…<
  • press >Manage Libraries…<
  • press >New Library…<
  • name it “jME”
  • select “Classpath” tab
  • press >Add JAR/Folder…<
  • select MY_PATH_TO_JME_CVS/jme/build (or MY_PATH_TO_JME_CVS/jme/target/*.jar)
  • select “Sources” tab
  • press >Add JAR/Folder…<
  • select MY_PATH_TO_JME_CVS/jme/src
  • select “Classpath” tab
  • press >Add JAR/Folder…<
  • select MY_PATH_TO_JME_CVS/jme/data/doc
  • press >OK<
  • press >Add Library<


Per Rosengren 2006/02/23 02:36


/var/www/wiki/data/pages/setting_up_netbeans_to_build_jme.txt · Last modified: 2010/01/24 16:49 by sbook  
Recent changes · Show pagesource · Login

Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki

subscribe to jME latest jme headlines


site design by bleedcrimson designs © 2008