Requirements

To finish this tutorial you will need:

  • NetBeans and the JDK. (download here, or here and find the latest version. Remember, you need JDK too.)
  • A SVN client binary (for Windows user, use the bundled SVN client shipped with Netbeans 6.7)

Source Download

Prepare Directories

We will be installing the sources into a directory, we will just use jME2 as the name

Windows

Create a new folder called jME2

Linux

mkdir jME2

Checkout jME2 from SVN

  • Start NetBeans.
  • Select Team → Subversion → Checkout from the menu.
  • In Repository URL, use
http://jmonkeyengine.googlecode.com/svn/trunk/
  • Leave the rest blank
  • Click Next.

  • Repository Folders should be set to trunk.
  • Select Skip trunk and checkout only its content.
  • Specify your jME2/jME2 location for Local Folder
  • Select Scan for NetBeans projects after checkout.
  • Click Finish
  • Wait until it checked out successfully.. You can have a closer look at jME here in the Wiki or Forum, or you can chat with jME people ;)
  • Now, right click on the opened “jMonkeyEngine (jar)” Project, and
  • delete it, make sure you UNSELECT also delete source under …
  • Ready for now 8-), we will create the Project you need later.

jME2 Compilation

Now that the sources have been downloaded, we need to compile them. Like already done, we had removed the maven project. That's because the maven build script is broken, but fortunately, jME also comes with a Ant script, which will perform the build steps for you.

Create a New Project

  • Create a new project in NetBeans, selecting a Java free-form project.
  • Set the location to your jME2/jME2 folder containing the SVN files.
  • Name it something if it hasn't already
  • Hit Next
  • Make sure there's the src folder in Source folders
  • Then remove the junit folder from Source folders and add it to Test folders
  • Hit next until the Dialog finishes

Compile Sources

Now we compile the project, test it, and generate Javadoc.

  • Right click jME2 project → Click Clean and build.
  • Right click jME2 project → Click Test the project.
  • Right click jME2 project → Click Generate Javadoc.
  • Right click jME2 project → Click Run.

It is OK if you see warnings, although errors are a problem.

Create the Libraries

jME2-Compile Library

  • Go to Tools>Libraries.
  • Click new library, and call this jME2-Compile.
  • Select the Classpath tab. Click “Add JAR/Folder”.
  • Go to your jME2 SVN. Select the build folder and confirm.
  • Select the Source tab. Click “Add JAR/Folder”.
  • Go to your jME2 SVN. Select the src folder and confirm.
  • Select the JavaDoc tab. Click “Add JAR/Folder”.
  • Go to your jME2 SVN. Select the data/doc folder and confirm.

jME2-Run Library

  • Click new Library, like we did at the very beginning of this step.
  • Call it jME2-Run.
  • Click “Add JAR/Folder”.
  • Go to lib folder inside JME2 project.
  • Select and add every .jar files you see (Java Executable Files) inside lib and subdirectories. If you use Linux, you don't have to add the .jar files on Linux and the same for Windows user, and so on. Jar files ARE actually folders. That's something beginners don't know. But make sure you added every .jar you have inside lib and subdirectories inside. (For me, now on December 2008, i have 9 when i end up, using Windows, if it helps). Make sure you have done this correctly, it's important.
  • Confirm.

Project Setup

Now that we have created the jME2 and jME2Physics libraries, these can be used in your projects. In this section, we'll guide you through the process of creating a new project with the right libraries.

  • Create a normal Java Application project.
  • Right click your project → Click Properties.
  • Click Libraries at the left, and the Compile tab, at the right. Press add library.
  • Select jME2-Compile and jME2Physics-Compile. Confirm.
  • Then select the run tab. Press add library.
  • Select jME2-Run and jME2Physics-Run. Confirm.
  • Under Run, set the VM OPTIONS to:

Windows

-Djava.library.path="jME2\jME2\lib\lwjgl\native\windows";"jME2\jME2Physics\impl\ode\lib"

Linux

-Djava.library.path="jME2/jME2/lib/lwjgl/native/linux":"jME2/jME2Physics/impl/ode/lib"

Where jME2/jME2 is the path to jME 2's SVN and jME2\jME2Physics is the path to jME Physics 2's SVN. (Native Library Explanation)

Now your project should be ready to work with.

Native Libraries Explanation

*These libraries (and the ones added to the jME-Physics2 project) are the 'native' libraries; basically they allow Java to tap directly into your hardware (ie. Video Card) and/or to run assembly (direct CPU) instructions. The libraries are loaded at run-time (when application starts up) and every project that uses jME (and/or jME-Physics) will have to be 'told' where these libraries are by use of the library path statement.


/var/www/wiki/data/pages/setting_up_netbeans_6.7_for_jme_svn.txt · Last modified: 2009/10/16 18:38 by drgnak  
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