Return to Tutorial 01

Here is an alternative way to use NativeFmodEx under Eclipse (prefered way is higly RECOMMENDED).
 

You will have to repeat all these steps for each project.

Create a new project named "First NativeFmodEx Project" in the folder :
   NATIVEFMODEX_FOLDER/Src/Examples
Create a second project named "NativeFmodEx Libs" in the folder :
   NATIVEFMODEX_FOLDER/lib/

In the first project, copy the folder Media and SimpleEventMedia from NATIVEFMODEX_FOLDER/Examples.

If you don't have installed NativeFmodEx in JDK/JRE, a lot of errors should be printed (org.jouvieje.FmodEx cannot be resolved ...). But no worry, we will see how to fix them.

Your workspace should looks like this :


Eclipse workspace (1)

Now, go to Properties of the first project. Choose the tab Libraries of Java Build Path view.
Add Jars... and select NativeFmodEx.jar and NativeFmodDesigner.jar from the second project.


Selecting Jars

Now, all the above errors should disappear.
If not, check in Window/Preferences/Java/Compiler that Compiler compliance level is a least 5.0 (ie use Java 5) and that the JRE selected in Window/Preferences/Java/Installed JREs is at least Java 5.0.

Remark : If you don't want to use Java 5 then don't use sources of the examples from NativeFmodEx Sdk.


No errors so we will try to run an example. I will explain you why it will fails at this stage.
To run PlaySound for example, right click on the class Run as -> Java Application.
The console should print this :

PlaySound - UnsatisfiedLinkError

    NativeFmodEx error! java.lang.UnsatisfiedLinkError : no fmodex in java.library.path

You've linked NativeFmodEx jars but not libraries. UnsatisfiedLinkError just tell you that FMOD Ex library can't be found.

To fix this, just specify using java.library.path the location of the libraries (NativeFmodEx AND FMOD Ex ones).
For this, go to Run/Run... (in Eclipse menu) and select the configuration just created (should be named PlaySound). In the tab Arguments, indicates where are FMOD Ex and NativeFmodEx libraries :


Selecting Libraries

Then run the project, unsatisified link should disappear and the example now works.

Note :
Don't be surprised if a lot of informations is printed in the console. This is due to that Eclipse console consider \r as \n. So, when the informations are updated in a new line is created instead of erasing current line (hope this will be fix one day).
 

 

Back

Next turorial

Last modified on 10/04/2007
Copyright © 2004-2010 Jérôme JOUVIE - All rights reserved. http://jerome.jouvie.free.fr/