setting_up_jme3_in_eclipse.adoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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:jme3/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. For a detailed description of the separate jar files see xref:jme3/jme3_source_structure#structure_of_jmonkeyengine3_jars,this list].
  25. == Setting up Assets
  26. The easiest way to make sure the asset manager can access the assets is by adding the assets folder to the classpath.
  27. . Go to `Project Properties`
  28. . Select `Java Build Path`
  29. . Under the `Source` tab click btn:[Add Folder]
  30. . Add your Assets folder
  31. == Writing a Simple Application
  32. . From the menu call `menu:File[New>New Package]`. Name the src package for example `hello`.
  33. . From the menu call `menu:File[New>Class]`.
  34. ** Select package `hello`.
  35. ** Name the class for example `MyGame`.
  36. ** Superclass: `com.jme3.app.SimpleApplication`
  37. ** Make sure that the checkbox to `Create the main() Method` is active.
  38. ** Make sure that the checkbox to `Inheriting Abstract Methods` is active.
  39. ** Click btn:[Finish].
  40. You can now continue to write xref:tutorials:beginner/hello_simpleapplication.adoc[your first jme3 application]!