setting_up_jme3_in_eclipse.adoc 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. = Setting up JME3 in Eclipse
  2. :revnumber: 2.0
  3. :revdate: 2020/07/15
  4. :keywords: documentation, install, eclipse
  5. For development with the jMonkeyEngine 3, we recommend to use the jMonkeyEngine SDK.
  6. Alternatively, you can use your favorite IDE: In this tutorial we show how to download and set up the latest nightly build of the jMonkeyEngine 3 for use with the Eclipse IDE. Instructions for xref:getting-started/setting_up_netbeans_and_jme3.adoc[NetBeans IDE] are also available.
  7. == Downloading jME3
  8. The currently available JAR binaries are the nightly builds.
  9. . Download the most recent zipped build from link:https://github.com/jMonkeyEngine/jmonkeyengine/releases[https://github.com/jMonkeyEngine/jmonkeyengine/releases]
  10. . Unzip the file and save it as `jME3.2-stable` in your home directory ($HOME). You should see the following files and directories:
  11. ** `lib/` – The jMonkeyEngine binaries, and libraries used by the jMonkeyEngine. (Don't remove)
  12. ** `jMonkeyEngine3.jar` – Run this to see various feature demos. (optional)
  13. ** `javadoc/` – jME3 +++<abbr title="Application Programming Interface">API</abbr>+++ documentation. (optional)
  14. == Creating a New Game Project
  15. * In Eclipse, choose `menu:File[New>Java Project]`
  16. * Project Name: `HelloJME3`
  17. * Click btn:[Finish]
  18. The new project appears in the Explorer.
  19. == Setting up Dependencies
  20. Your project depends on the jMonkeyEngine libraries and needs to know where they are.
  21. . Right-click the project in the explorer and choose `menu:Build Path[Add External Archives]`
  22. . In the "`JAR`" selection dialog, browse to the `$HOME/jME3.2-stable` directory.
  23. . Select all JARs in the `lib` directory and click Open.
  24. All necessary JAR libraries are now on the classpath and should appear in the Referenced Libraries list.
  25. include::partial$source-structure-link.adoc[]
  26. == Setting up Assets
  27. The easiest way to make sure the asset manager can access the assets is by adding the assets folder to the classpath.
  28. . Go to `Project Properties`
  29. . Select `Java Build Path`
  30. . Under the `Source` tab click btn:[Add Folder]
  31. . Add your Assets folder
  32. == Writing a Simple Application
  33. . From the menu call `menu:File[New>New Package]`. Name the src package for example `hello`.
  34. . From the menu call `menu:File[New>Class]`.
  35. ** Select package `hello`.
  36. ** Name the class for example `MyGame`.
  37. ** Superclass: `com.jme3.app.SimpleApplication`
  38. ** Make sure that the checkbox to `Create the main() Method` is active.
  39. ** Make sure that the checkbox to `Inheriting Abstract Methods` is active.
  40. ** Click btn:[Finish].
  41. You can now continue to write xref:tutorials:beginner/hello_simpleapplication.adoc[your first jme3 application]!