<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Setting Up Eclipse &mdash; Sponge 6.0.0 documentation</title>

    <link rel="shortcut icon" href="../../_static/favicon.ico"/>




    <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />

    <link rel="stylesheet" href="../../_static/spongedocs.css" type="text/css" />

        <link rel="index" title="Index"
              href="../../genindex.html"/>        <link rel="search" title="Search" href="../../search.html"/>    <link rel="top" title="Sponge 6.0.0 documentation" href="../../index.html"/>        <link rel="up" title="Setting Up Your Workspace" href="index.html"/>        <link rel="next" title="Setting Up Your Project" href="../project/index.html"/>        <link rel="prev" title="Setting Up IntelliJ IDEA" href="idea.html"/>
    <!-- Google Analytics -->
    <script>
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-59476017-2', 'auto');
        ga('send', 'pageview');
    </script>

  <script src="../../_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
    <div id="sp-logo-container" class="page-scroll">
        <a class="logo" href="../../index.html">
            <img src="../../_static/spongie-mark-dark.svg">
            <span>Sponge</span>
            <i class="fa fa-fw fa-chevron-down"></i>
        </a>
        <div id="sp-logo-menu">
            <ul id="sp-logo-dropdown">
                <li><a href="https://www.spongepowered.org"><i class="fa-fw fa fa-home"></i>Homepage</a></li>
                <li><a href="https://forums.spongepowered.org"><i class="fa-fw fa fa-comments"></i>Forums</a></li>
                <li><a href="https://github.com/SpongePowered"><i class="fa-fw fa fa-code"></i>Code</a></li>
                <li class="active"><a href="https://docs.spongepowered.org"><i class="fa-fw fa fa-book"></i>Docs</a></li>
                <li><a href="https://jd.spongepowered.org"><i class="fa-fw fa fa-graduation-cap"></i>Javadocs</a></li>
                <li><a href="https://forums.spongepowered.org/c/plugins/plugin-releases"><i class="fa-fw fa fa-plug"></i>Plugins</a></li>
                <li><a href="https://www.spongepowered.org/downloads"><i class="fa-fw fa fa-download"></i>Downloads</a></li>
                <li><a href="https://www.spongepowered.org/chat"><i class="fa-fw fa fa-comment"></i>Chat</a></li>
            </ul>
        </div>
    </div>

<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
                <ul>
<li class="toctree-l1"><a class="reference internal" href="../../server/index.html">Creating a Server</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../preparing/index.html">Preparing for Development</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Creating a Plugin</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../buildsystem.html">Build Systems</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Setting Up Your Workspace</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="idea.html">Setting Up IntelliJ IDEA</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Setting Up Eclipse</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../project/index.html">Setting Up Your Project</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugin-identifier.html">Plugin Identifiers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugin-class.html">Main Plugin Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lifecycle.html">Plugin Lifecycle</a></li>
<li class="toctree-l2"><a class="reference internal" href="../injection.html">Dependency Injection</a></li>
<li class="toctree-l2"><a class="reference internal" href="../practices/index.html">Practices</a></li>
<li class="toctree-l2"><a class="reference internal" href="../optional/index.html">Optionals</a></li>
<li class="toctree-l2"><a class="reference internal" href="../logging.html">Logging and Debugging</a></li>
<li class="toctree-l2"><a class="reference internal" href="../commands/index.html">Commands</a></li>
<li class="toctree-l2"><a class="reference internal" href="../event/index.html">Events</a></li>
<li class="toctree-l2"><a class="reference internal" href="../assets.html">The Asset API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../configuration/index.html">Configuring Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../text/index.html">Text</a></li>
<li class="toctree-l2"><a class="reference internal" href="../data/index.html">The Data API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../blocks/index.html">Blocks</a></li>
<li class="toctree-l2"><a class="reference internal" href="../entities/index.html">Entities</a></li>
<li class="toctree-l2"><a class="reference internal" href="../items/index.html">Items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../trade-offers.html">Trade-Offers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../effects.html">Effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="../scheduler.html">Scheduler</a></li>
<li class="toctree-l2"><a class="reference internal" href="../services.html">Services</a></li>
<li class="toctree-l2"><a class="reference internal" href="../database.html">Databases</a></li>
<li class="toctree-l2"><a class="reference internal" href="../permissions.html">Permissions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bans.html">Bans</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bookview.html">Book Views</a></li>
<li class="toctree-l2"><a class="reference internal" href="../economy/index.html">Economy</a></li>
<li class="toctree-l2"><a class="reference internal" href="../wgen/index.html">World Generation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../manager.html">Plugin Manager</a></li>
<li class="toctree-l2"><a class="reference internal" href="../game-profile-manager.html">Game Profile Manager</a></li>
<li class="toctree-l2"><a class="reference internal" href="../offline-userplayer-data.html">Offline Player Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="../debugging.html">Plugin Debugging</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tab-lists.html">Tab Lists</a></li>
<li class="toctree-l2"><a class="reference internal" href="../plugin-meta.html">Plugin Metadata</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ray-tracing.html">Ray Tracing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorials.html">Tutorials</a></li>
<li class="toctree-l2"><a class="reference internal" href="../internals/index.html">Implementation-dependent Plugins</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../ore/index.html">Ore Documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../contributing/index.html">Contributing to Sponge</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../about/index.html">About the Sponge Project</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="../../index.html">Sponge</a>
      </nav>


      <div class="wy-nav-content">
        <div class="rst-content">

 

<div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../../index.html">Docs</a> &raquo;</li>
          <li><a href="../index.html">Creating a Plugin</a> &raquo;</li>
          <li><a href="index.html">Setting Up Your Workspace</a> &raquo;</li>
    <li>Setting Up Eclipse</li>
      <li class="wy-breadcrumbs-aside">
            <a href="https://github.com/SpongePowered/SpongeDocs/blob/BestPractises/source/plugin/workspace/eclipse.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
  <div class="section" id="setting-up-eclipse">
<h1>Setting Up Eclipse<a class="headerlink" href="#setting-up-eclipse" title="Permalink to this headline">¶</a></h1>
<p>This article describes how to configure your <strong>Eclipse</strong> workspace for plugin development with SpongeAPI and <a class="reference internal" href="../buildsystem.html"><span class="doc">a
build system such as Maven or Gradle</span></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">A tutorial by Mumfrey showing the setup of a Sponge workspace in Eclipse, using the new features in Buildship and ForgeGradle,
can be viewed <a class="reference external" href="https://www.youtube.com/watch?v=R8NcakQtHVI">here</a>.</p>
</div>
<div class="section" id="gradle">
<h2>Gradle<a class="headerlink" href="#gradle" title="Permalink to this headline">¶</a></h2>
<div class="section" id="preparing-gradle">
<h3>Preparing Gradle<a class="headerlink" href="#preparing-gradle" title="Permalink to this headline">¶</a></h3>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Gradle is automatically included in Eclipse starting from the Neon release (June 22, 2016) and later. These steps are only required for earlier versions.</p>
</div>
<p>You must first install the <strong>Gradle Integration Plugin</strong> before using Gradle in Eclipse. This only needs to be done
upon the creation of your first project.</p>
<div class="admonition tip">
<p class="first admonition-title">Tip</p>
<p class="last">Typically, you do not need the optional Spring modules distributed with this plugin, so you can uncheck them during
installation.</p>
</div>
<ul class="simple">
<li>Open <strong>Eclipse</strong>.</li>
<li>Click <code class="docutils literal"><span class="pre">Help</span> <span class="pre">&gt;</span> <span class="pre">Eclipse</span> <span class="pre">Marketplace</span></code>.</li>
<li>Search for <code class="docutils literal"><span class="pre">Gradle</span> <span class="pre">Integration</span> <span class="pre">Plugin</span></code>.</li>
<li>Install the <strong>Gradle Integration Plugin</strong>.</li>
</ul>
</div>
<div class="section" id="creating-your-project">
<h3>Creating your project<a class="headerlink" href="#creating-your-project" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Open <strong>Eclipse</strong>.</li>
<li>Click <code class="docutils literal"><span class="pre">File</span> <span class="pre">&gt;</span> <span class="pre">New</span> <span class="pre">&gt;</span> <span class="pre">Other</span></code>.</li>
<li>Select <code class="docutils literal"><span class="pre">Gradle</span> <span class="pre">&gt;</span> <span class="pre">Gradle</span> <span class="pre">Project</span></code>.</li>
<li>Click <code class="docutils literal"><span class="pre">Next</span></code>.</li>
<li>Enter a project name, then click <code class="docutils literal"><span class="pre">Finish</span></code>.</li>
</ul>
</div>
<div class="section" id="editing-the-build-script">
<h3>Editing the build script<a class="headerlink" href="#editing-the-build-script" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Open <code class="docutils literal"><span class="pre">build.gradle</span></code> in the navigator.</li>
<li>Edit the build script according to the instructions at <a class="reference internal" href="../project/gradle.html"><span class="doc">Setting Up Gradle</span></a>.</li>
<li>Right-click your project, and select <code class="docutils literal"><span class="pre">Gradle</span> <span class="pre">&gt;</span> <span class="pre">Refresh</span> <span class="pre">Gradle</span> <span class="pre">Project</span></code>.</li>
</ul>
</div>
<div class="section" id="importing-your-project">
<h3>Importing your project<a class="headerlink" href="#importing-your-project" title="Permalink to this headline">¶</a></h3>
<p>If you&#8217;ve already started with your project and want to import it again at a later point you need to import it instead
of re-creating it inside your IDE:</p>
<ul class="simple">
<li>Click <code class="docutils literal"><span class="pre">File</span> <span class="pre">&gt;</span> <span class="pre">Import</span></code></li>
<li>Select <code class="docutils literal"><span class="pre">Gradle</span> <span class="pre">&gt;</span> <span class="pre">Gradle</span> <span class="pre">Project</span></code></li>
<li>Navigate to the root folder of the project</li>
<li>Click Finish</li>
</ul>
</div>
</div>
<div class="section" id="maven">
<h2>Maven<a class="headerlink" href="#maven" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id1">
<h3>Creating your project<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Open <strong>Eclipse</strong>.</li>
<li>Click <code class="docutils literal"><span class="pre">File</span> <span class="pre">&gt;</span> <span class="pre">New</span> <span class="pre">&gt;</span> <span class="pre">Other</span></code>.</li>
<li>Select <code class="docutils literal"><span class="pre">Maven</span></code> on the left side of the popup, and select <code class="docutils literal"><span class="pre">Maven</span> <span class="pre">Project</span></code> on the right side.</li>
<li>Click <code class="docutils literal"><span class="pre">Next</span></code>.</li>
<li>Select <code class="docutils literal"><span class="pre">Create</span> <span class="pre">a</span> <span class="pre">simple</span> <span class="pre">project</span></code>, unless you require a more advanced setup.</li>
<li>Enter your <strong>Group ID</strong>, <strong>Artifact ID</strong>, <strong>Version</strong>, project name, and project description.<ul>
<li>Your <strong>Group ID</strong> should usually correspond to your Java package name. See <a class="reference internal" href="../plugin-class.html"><span class="doc">Main Plugin Class</span></a> for details.</li>
<li>Your <strong>Artifact ID</strong> should usually correspond to your <strong>plugin ID</strong> you chose earlier, e.g. <code class="docutils literal"><span class="pre">myplugin</span></code>.</li>
<li>Your <strong>Version</strong> is up to you.</li>
</ul>
</li>
<li>Click <code class="docutils literal"><span class="pre">Finish</span></code>.</li>
</ul>
<div class="admonition tip">
<p class="first admonition-title">Tip</p>
<p class="last">Eclipse often does not open new projects after creating them. If this happens, try closing the Eclipse welcome
screen; your project should be open behind it.</p>
</div>
</div>
<div class="section" id="editing-the-project-configuration">
<h3>Editing the project configuration<a class="headerlink" href="#editing-the-project-configuration" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Open <code class="docutils literal"><span class="pre">pom.xml</span></code> in the navigator.</li>
<li>Edit the build configuration according to the instructions at <a class="reference internal" href="../project/maven.html"><span class="doc">Setting Up Maven</span></a>.</li>
<li>Refresh your Maven project.</li>
</ul>
</div>
<div class="section" id="id2">
<h3>Importing your project<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<p>If you&#8217;ve already started with your project and want to import it again at a later point you need to import it instead
of re-creating it inside your IDE:</p>
<ul class="simple">
<li>Click <code class="docutils literal"><span class="pre">File</span> <span class="pre">&gt;</span> <span class="pre">Import</span></code></li>
<li>Select <code class="docutils literal"><span class="pre">Maven</span> <span class="pre">&gt;</span> <span class="pre">Existing</span> <span class="pre">Maven</span> <span class="pre">Projects</span></code></li>
<li>Navigate to the root folder of the project</li>
<li>Click Finish</li>
</ul>
</div>
</div>
<div class="section" id="git-integration">
<h2>Git Integration<a class="headerlink" href="#git-integration" title="Permalink to this headline">¶</a></h2>
<p>The Eclipse Foundation offers documentation on using Eclipse&#8217;s EGit plugin:</p>
<p><a class="reference external" href="https://www.eclipse.org/egit/documentation/">https://www.eclipse.org/egit/documentation/</a></p>
</div>
</div>

           </div>
          </div>
<footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../project/index.html" class="btn btn-neutral float-right" title="Setting Up Your Project" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
        <a href="idea.html" class="btn btn-neutral" title="Setting Up IntelliJ IDEA" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&copy; Copyright 2014-2017, Sponge Contributors.
    </p>
  </div>Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 
</footer>
        </div>
      </div>

    </section>

  </div>


<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
    <span class="rst-current-version" data-toggle="rst-current-version">
        <i class="fa fa-book"> <span>SpongeDocs</span></i>
        v: 6.0.0
        <span class="fa fa-caret-down"></span>
    </span>
    <div id="versions" class="rst-other-versions">




            <dl>
                <dt>Contribute</dt>
                    <dd><a href="https://github.com/SpongePowered/SpongeDocs/blob/BestPractises/source/plugin/workspace/eclipse.rst">Source</a></dd>
                    <dd><a href="https://github.com/SpongePowered/SpongeDocs/edit/BestPractises/source/plugin/workspace/eclipse.rst">Edit</a></dd>
            </dl>
    </div>
</div>

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'../../',
            VERSION:'6.0.0',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true
        };
    </script>      <script type="text/javascript" src="../../_static/jquery.js"></script>      <script type="text/javascript" src="../../_static/underscore.js"></script>      <script type="text/javascript" src="../../_static/doctools.js"></script>      <script type="text/javascript" src="../../_static/spongedocs.js"></script>

    <script type="text/javascript" src="../../_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
 
</body>
</html>