How to build in netbeans?

hi can anyone tell me how to compile the demos in the latest netbeans IDE for JME 2.0?



The tutorials on this website only cover JME 1.0

I dont know in netbeans, because the version of jme i download doesnt apper as a project of netbeans. However you can run the demos writing in the console:



ant run-testchooser



into the jme 2.0 directory, exactly in the same place where the build.xml file appears.




Im not very good with the command line, it just says 'ant not found'



should i use JME 1.0 or another IDE??

mmm, i dont know how works netbeans without ant… are you in Linux or windows? is it the first time with Netbeans?

i would install ant, you will need it now or later…

im in windows

do you know what directory ants installs to?



yeah im a newbie with netbeans

i just tried eclipse and it was worse!



i couldnt get the reposotories to work

im making some progress



The SVN repository needed to be updated to get all the proper files



now, after following all the steps of the tutorial



when i try to run the project it just says 'running' but doesn't run the test chooser

I use NetBean 6.0 and jMe 1.0. But it should be the same for jMe 2.0.



After setting up SVN/CSV and creating an Ant Projet.

Select build.xml in the jMe project -> Right click -> Run target -> Run-testchooser



In the Run target, you can find all the ant script (build, dist, run, …)

thanks

it says ' no lwjgl in java.library.path'



but i did include lwjgl.jar in the libraries

That error is talking about native files, not jars. 

how do i fix the error?



install lwjgl?

The dlls who are causing the error have changed to a new path .

That is why you have the error.

how do I fix that?



Im not sure I actually have the DLL's how would I check?

-Djava.library.path=

Here's a more complex but hopefully more versatile approach:



import java.io.File;

import java.io.IOException;

import java.lang.reflect.Field;



/

 

 
@author antony_miguel

 * http://forums.sun.com/thread.jspa?messageID=4096896

 */

public class LibPathHacker

{

    public static void addDir(String directory)

            throws IOException

    {

        try

        {

            Field field = ClassLoader.class.getDeclaredField("usr_paths");

            field.setAccessible(true);

            String[] paths = (String[])field.get(null);

            for (int i = 0; i < paths.length; i++)

            {

                if (directory.equals(paths[i]))

                {

                    return;

                }

            }

            String[] tmp = new String[paths.length + 1];

            System.arraycopy(paths, 0, tmp, 0, paths.length);

            tmp[paths.length] = directory;

            field.set(null, tmp);

            System.setProperty("java.library.path", System.getProperty("java.library.path") + File.pathSeparator + directory);

        }

        catch (IllegalAccessException e)

        {

            throw new IOException("Failed to get permissions to set library path");

        }

        catch (NoSuchFieldException e)

        {

            throw new IOException("Failed to get field handle to set library path");

        }

    }

}





And here is how I use it:



public class ClientGame extends BaseGame

{



    public static void main( String[] args )

    {

        Logger.getLogger( "" ).setLevel( Level.WARNING );

        if(setNativeLibraries())

        {

            ClientGame clientGame = new ClientGame();

            clientGame.setConfigShowMode(ConfigShowMode.ShowIfNoConfig);

            clientGame.start();

        }

    }



    /
Path to the native libraries */

    final static String m_nativePath = "Native" + File.separator;



    private static boolean setNativeLibraries()

    {

        try

        {

            LibPathHacker.addDir(m_nativePath + "Windows");

        }

        catch (IOException ex)

        {

            Logger.getLogger(ClientGame.class.getName()).log(Level.SEVERE, null, ex);

            return false;

        }



        return true;

    }

}

Open your Projects Windows > Right click > Properties > Choose the Run under the Build part > Look for the VM Options > Put this in the text field: -Djava.library.path=./bin-libs/



Now the bin-libs folder needs to be in your project folder and needs to contain the native DLL’s. These are: jinput-raw.dll, lwjgl.dll, OpenAL32.dll, jinput-dx8.dll.



Did you follow this guide: http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_netbeans_5.0_to_build_jme_and_jme-physics_2? You should of created the jME-compile and jME-run libraries. You need to import these libraries for jME projects.



You need to create a project to run a demo. Just drag and drop them into the “Source packages,” import the jME libraries and do the first thing I described above.



I hope this helped a little bit. :slight_smile:

yeh i followed the guide but no luck



i cant find vm options because im not using jme-physics at all

It's not like there is a tutorial on the wiki or anything.