NetBeans6Stendhal: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Timothyb89
Initial creation
imported>SimonSmall
Added category NetBeans
 
(49 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Navigation for Stendhal Top|Building & Hosting}}
{{Navigation for Stendhal Builders and Hosters}}


== Warning ==
Most of our developers use Eclipse, so using that is recommended, unless you are an experienced Netbeans user.

==Why another tutorial?==
==Why another tutorial?==
I know- there's already a tutorial for NetBeans, but it was written for older versions of NetBeans (namely, version 5.5). NetBeans 6 is considerably different and allows '''much''' easier configuration. Also, I'm trying to convert some over the other devels using Eclipse :)
I know- there's already a tutorial for NetBeans, but it was written for older versions of NetBeans (namely, version 5.5). NetBeans 6 is considerably different and allows '''much''' easier configuration. Also, I'm trying to convert some over the other devels using Eclipse :)
Line 9: Line 16:


== Step 1: Getting the sources ==
== Step 1: Getting the sources ==
If you want the "stable" code, head over [http://sourceforge.net/projects/arianne SourceForge] and download the latest Stendhal source distribution. Download this and extract it somewhere, ex. $HOME/Stendhal/source. (it must be in a subdirectory if you are OCD like me and like keeping random things organized).
If you want the "stable" code, head over [http://sourceforge.net/projects/arianne SourceForge] and download the latest Stendhal source distribution. Download this and extract it somewhere, ex. $HOME/Stendhal/source. (it must be in a subdirectory if you are OCD like me and like keeping random things organized). However, I recommend you get CVS as that is what I'm writing the tutorial from.


----
----
Line 24: Line 31:
<br/>
<br/>
'''Everyone else:'''<br/>
'''Everyone else:'''<br/>
CVS Root: :pserver:anonymous@arianne.cvs.sourceforge.net:/cvsroot/arianne
CVS Root: :pserver:anonymous@arianne.cvs.sourceforge.net:/cvsroot/arianne<br/>
Password: Empty.
Password: Empty.<br/>


Click Next.
Click Next.
Line 37: Line 44:
'''Module:''' stendhal<br/>
'''Module:''' stendhal<br/>
'''Branch:''' leave empty<br/>
'''Branch:''' leave empty<br/>
'''Local folder:''' Enter a path to a directory on your system in which to place the stendhal sources. For example, /home/me/Stendhal/source
'''Local folder:''' Enter a path to a directory on your system in which to place the Stendhal sources. For example, /home/me/Stendhal/source.
</p>
</p>
http://timothyb89.homelinux.org/wikipix/stend-nb6/cvs-co2.png
http://timothyb89.homelinux.org/wikipix/stend-nb6/cvs-co2.png


<p>
<p>
Click '''Finish''' to begin checking out the code/data. The progress will be displayed in the Output pane on the bottom of the main NetBeansWindow.
Click '''Finish''' to begin checking out the code/data. The progress will be displayed in the Output pane on the bottom of the main NetBeans indow.
http://timothyb89.homelinux.org/wikipix/stend-nb6/cvs-co3.png
http://timothyb89.homelinux.org/wikipix/stend-nb6/cvs-co3.png w</p>

== Creating a project ==
<p>
To create a new project, simply go to '''File'''>'''New Project'''. From there, choose a '''Java''', and move on to '''Java Project with Existing Sources''', and click '''Next'''.
</p>
</p>

<p>
You should now see the "Name and Location" panel. Fill in the following details:<br/>
'''Project Name:''' Can be anything; I'm using Stendhal.<br/>
'''Project Folder:''' Should be in the directory above your sources directory. If you used $HOME/Stendhal/sources, it should be something like $HOME/Stendhal/NetBeans<br/>

http://timothyb89.homelinux.org/wikipix/stend-nb6/mkprj1.png
</p>

<p>
At this point, you should see panels for source and test folder entry.<br/>
In the Source Package Folders section, add '''/path/to/Stendhal/'''source/stendhal/src (replace the bold text with the location of your Stendhal directory).<br/>
In the Test Package Folders section, add '''/path/to/Stendhal/'''source/stendhal/tests (again, replace bold).<br/>

To complete the setup, click '''Finish.'''<br/>

http://timothyb89.homelinux.org/wikipix/stend-nb6/mkprj2.png
</p>

== Add Libraries ==
<p>
This could be the easiest step :)<br/>
First off, in the '''"Projects" ''' pane, expand the new Stendhal project, right click on '''Libraries ''', and choose '''Add JAR/Folder...'''.<br/>
Now, navigate to '''/path/to/Stendhal/'''source/stendhal/libs/ and, holding the '''Control''' or '''Shift''' key, '''select each jar''' and '''click Open'''.

http://timothyb89.homelinux.org/wikipix/stend-nb6/addlibs.png
</p>

== Configure Project ==
<p>
The last step is to set up the project to run the code. I will go over setting up the IDE to run the client, but not the server. Though I'm not going over this, it is possible.<br/>

The first thing to do is right click on the new project in the '''Project''' pane, found on left of the main IDE window. From there, choose, choose '''Properties'''.<br/>

You should now see the project properties window. First, choose '''Libraries''' from the left, and then the '''Run''' tab in the main pane. From here, choose '''Add JAR/Folder''' and add your stendhal folder. For example, add '''/path/to/Stendhal/'''source/stendhal . <br/>

http://timothyb89.homelinux.org/wikipix/stend-nb6/conf1.png
</p>
----
<p>
Now choose '''Run''' in the left menu again. Choose '''New''', enter '''Client''' for the name, and fill in the following: (Any information not provided should be left empty)<br/>
* '''Main Class:''' games.stendhal.client.stendhal<br/>
* '''VM Options:''' -Xmx256m<br/>

Now you can simply click '''OK''' to finish.<br/>

http://timothyb89.homelinux.org/wikipix/stend-nb6/conf2.png

</p>

== Finish Setup ==
You should be done, so hit the run button on the main toolbar to start the client.

http://timothyb89.homelinux.org/wikipix/stend-nb6/runbtn.png

[[Category:Stendhal]]
[[Category:NetBeans]]