Stendhal on Eclipse: Difference between revisions

From Arianne
Jump to navigation Jump to search
Content deleted Content added
imported>MartinFuchs
mNo edit summary
imported>Hendrik Brummermann
Do not add the project root folder as source path
Line 8: Line 8:
# Now add '''three source folders''' by clicking on the "Add Folder..." button
# Now add '''three source folders''' by clicking on the "Add Folder..." button
<pre>
<pre>
source folder #1:
source folder #1:
stendhal
Included:(All)
Excluded:build-archive/;build/;src/;tests/;tiled/src;tools/creaturesxml/;tools/newrp/
Native library location: (None)

source folder #2:
stendhal/src
stendhal/src
Included:(All)
Included:(All)
Line 20: Line 14:
Native library location: (None)
Native library location: (None)


source folder #3:
source folder #2:
stendhal/tests
stendhal/tests
Included:(All)
Included:(All)
Line 61: Line 55:
button "Advanced"
button "Advanced"
(*) add folder | OK
(*) add folder | OK
and select the root folder | OK
and select the project root folder | OK

button "Add JARs..."
select /Stendhal/libs/commons-lang.jar | OK
</pre>
</pre>


Line 75: Line 66:
# then again the small black arrow on the right side of the green bug.
# then again the small black arrow on the right side of the green bug.
# Java Application -> new-icon, and it should be prefilled.
# Java Application -> new-icon, and it should be prefilled.
# for the client the [Classpath] advanced root folder setting is not needed, since the project root directory is already included in the classpath (see above).
# on the [Classpath] tab - button "Advanced" - (*) add folder | OK - and select the project root folder | OK


yay shiny new client, shiny server
yay shiny new client, shiny server

Revision as of 08:16, 25 November 2007

First Steps

  1. First of all open the view called Package Explorer.
  2. Create new 'Java Project'
  3. Get stendhal from CVS. (Connection type: pserver, User: anonymous, Password - leave blank, Host:arianne.cvs.sourceforge.net, Repository: /cvsroot/arianne)
  4. Make sure that the marauroa.ini (server.ini, for Stendhal version 0.63 or above) is in your stendhal project folder - only needed if you will be running the server.
  5. Right click on your project folder and select "Properties" in the context menu.
  6. Then select "Java Build Path" on the left side of the dialog box.
  7. Now add three source folders by clicking on the "Add Folder..." button
source folder #1:
          stendhal/src
               Included:(All)
               Excluded:(None)
               Native library location: (None)

source folder #2: 
          stendhal/tests
               Included:(All)
               Excluded:(None)
               Native library location: (None)

default output folder: stendhal/bin

8. On the "Libraries" tab: click on the "Add JARs" button and select all the files in stendhal/lib

Eclipse should be able to compile the source code now. There should be a little yellow sign (signalling warning messages) before your project folder but not red X (error messages). The package explorer should now display the "src" folder below the root folder with a different icon, the icon is like a small grid.

Trouble Shooting

menu Windows | Preferences | Java | Installed JREs

  • there should be at least one entry with a valid JAVA_HOME path (make it so so JDK compliance is 5.0  ?)

If you happen to get this: The method getLayerVector() is undefined for the type MapMapConverter.javastendhal/src/games/stendhal/toolsline 111

  • please right click your project folder again --> properties -> java build path.
  • in the [source] tab there should only be stendhal/src, so remove stendhal/tiled/src

(This entry has higher priority than the tiled.jar in the libs folder but this code is highly outdated)

To make it run the server in Debug mode

  • In the toolbar there is the "Debug" button, which looks like a little, green bug. There is a little black arrow on the right side of it.
  • This will open a menu, please choose "Open Debug Dialog..."
  • Then in the dialog select "Java Application" and click on the "new" icon in the top left corner.
 Name: StendhalServer
 Main class: marauroa.server.marauroad
 [ ] include system libries when searching for the main class    (default)
 [ ] include inherited mains when searching for the main class   (default)
 [ ] Stop in main    (default)

on the [Arguments] tab:
Program arguments: -c server.ini -l  (optional)
VM arguments: -Xmx128M

on the [Classpath] tab:
 button "Advanced"
(*) add folder | OK
 and select the project root folder | OK
  • button [Debug]

And then the server should be started. Note: you may need to 'add external jars' and add your mysql jar from your ant build type server, if you have that already, or download from http://dev.mysql.com/downloads/connector/j/3.0.html (there are newer mysql available on the same site but I have 3.0 and it seems fine.)

To make the client run

  1. Open games.stendhal.client.update.Starter.java in the editor
  2. then again the small black arrow on the right side of the green bug.
  3. Java Application -> new-icon, and it should be prefilled.
  4. on the [Classpath] tab - button "Advanced" - (*) add folder | OK - and select the project root folder | OK

yay shiny new client, shiny server

External links