Set Up the Eclipse IDE for Windows

So far, you've configured your environment, installed the Atlassian SDK, and created a HelloWorld plugin project. You've tweaked the plugin project a bit but so far your plugin does nothing. Of course, you've done all this on the command line --- most programmers prefer the advantages of an IDE. So, on this page, you configure the Eclipse IDE to work with the SDK.

Linux or Mac User?

 See this page.

IntelliJ User?

 See this page.

Do I have to Use Eclipse?

If you already have a version of Eclipse installed you don't need to do this step. Note that the tutorial assumes a particular version of Eclipse, so you should anticipate that you may need to adjust procedures if you choose to use another version of it. If you aren't interested in using Eclipse and prefer another IDE, you are perfectly free to skip this page. However, the rest of this tutorial assumes you are using Eclipse.

Step 1: Install the Eclipse IDE

In this step, you download and install the Eclipse IDE for Java EE Developers (Indigo). This version of Eclipse comes with most of the Maven dependencies already installed. Do the following to install Eclipse in your system:

  1. Download the Eclpse IDE for Java EE developers.
     This IDE has many of the dependencies required by the Maven Eclipse plugin.

  2. Expand the ZIP file into the root of your hard drive.
    When you are done, if your hard drive root is the C:\ drive you will have the following folder on your hard drive:

Step 2: Configure the Eclipse Plugin to start under JDK 1.6

In this step, you edit the Eclipse initialization file. Do the following:

  1. Make a note of the location of your JDK 1.6 installation.
    Your root should be similar to: C:\Program Files\Java\jdk1.6.0_32
  2. Navigate to the root of the Eclipse installation.
  3. Make a copy of the eclipse.ini file.
    This is good practice any time you are about to edit a configuration file. It allows you to get back to the original if you make a mistake.
  4. Name the copy eclipse.ini.original.
  5. Edit the eclipse.ini file with your favorite text editor.
  6. Add a -vm entry to file before any -vmargs entry.
    The entry should point to the bin directory of your JDK.  The eclipse.ini file requires that you reverse the slashes from back to forward slashes.  When you are done the file will look similar to the following:

    -startup
    plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
    -product
    org.eclipse.epp.package.jee.product
    --launcher.defaultAction
    openFile
    --launcher.XXMaxPermSize
    256M
    -showsplash
    org.eclipse.platform
    --launcher.XXMaxPermSize
    256m
    --launcher.defaultAction
    openFile
    -vm
    C:/Program Files/Java/jdk1.6.0_32/bin
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Xms40m
    -Xmx512m
  7. Close and save the file.

Step 3: Start Eclipse and update the Installed JREs

Start Eclipse and do the following:

  1. Choose Windows > Preferences from the Eclipse menu bar.
    The system displays the preferences dialog.
  2. Filter for or navigate to the Installed JREs page.
  3. Click the Add button.
    The Add JRE wizard displays.
  4. Make sure Standard VM is selected and press Next.
  5. Press Directory.
    The Browse For Folder dialog appears.
  6. Navigate to your JDK installation.
  7. Press OK.
    Eclipse locates all the libraries. At this point the dialog should look similar to the following:
  8. Press Finish.
    The system returns you to the Installed JREs page.
  9. Check the JDK you just added.
    The dialog should look similar to this:
  10. Press OK to close the dialog.

Step 4: Install the Maven Eclipse Plugin

Start Eclipse and do the following:

  1. Choose Help > Install New Software.
    The Available Software dialog appears. 
  2. Click the Add button.
    The Add Repository dialog appears. 
  3. Enter Sonatype M2Eclipse in the Name field.
  4. Enter http://download.eclipse.org/technology/m2e/releases in the Location field.
  5. Press OK to close the dialog.
    The system searches the site for the plugin. After a moment, the Name field fills with the Maven Integration for Eclipse as the following: 
  6. Check the box and press Next.
  7. Select Maven Integration for Eclipse.
  8. Press Next and Next again.
  9. Accept the terms of the license agreement and press Finish.
    Eclipse calculates the dependencies and space. 
  10. Press Next.
  11. Accept the License agreement and press Next.
    The installation procedure runs.
  12. Restart Eclipse when prompted.

Step 5: Configure the Maven Plugin

After the Eclipse restarts, you need to ensure that the M2E plugin is configured:

  1. Choose Windows > Preferences from the Eclipse menu bar.
    The system displays the preferences dialog.
  2. Filter for or navigate to the Maven > Installations page.
  3. Click the Add button.
    The Maven Installation dialog displays.
  4. Browse to your c:\atlassian-plugin-sdk\apache-maven installation.
  5. Press OK.
    The system sets this external repository for you. The dialog should look like the following:
  6. Ensure the Global settings are coming from the installation directory.
  7. Press Apply.
  8. Click the Maven root.
  9. Uncheck Download repository index updates on startup.
    This prevents Maven from updating on Eclipse startup which can be time consuming. The atlas- commands all update the repositories for you.
  10. Press OK to close the dialog.

Step 6: Set Up a DOS Shell in Eclipse

Once you have Eclipse configured to use the Atlassian SDK, you would still need to keep a DOS command prompt open in which to run each command. This is very handy if you want an "all in one" workspace. In this step, you create an external tool configuration that opens the DOS command prompt in an Eclipse console window. In this window, you can enter the atlas commands.

If you haven't already done so, start Eclipse and then do the following:

  1. Make sure your workspace is set to your atlastutorial project.
    You can use File > Switch Workspace > Other to switch if you need to. You need to do this because run configurations are associated with a workspace. 
  2. Click to Run > External Tools > External Tools Configuration... from the Eclipse menu bar.
    The External Tools Configuration dialog appears. 
  3. Select Programs and press New launch configuration.

    The system creates a new configuration and places you in a configuration dialog.
  4. Name the new configuration DOS cmd Prompt.
  5. Click Browse File System....
  6. Navigate to the location of the cmd.exe program.
    This should be in the C:\WINDOWS\system32\cmd.exe directory. 
  7. Add the ${workspace_loc} variable to the Working Directory section.
    When you are done, the dialog will appear as follows: 
  8. Click the Common tab.
  9. Check External Tools under Display in Favorites menu.
  10. Make sure the Allocate console (necessary for input) option is checked.
  11. Press Apply to save your configuration.
  12. Press Close to close the dialog.

 Go ahead and try your new configuration.  Launch the DOS cmd Prompt from within Eclipse:

You should see the prompt appear in an Eclipse console:

The console doesn't support everything a regular DOS window does, but it does everything you need for most of your work with the SDK.

The Next Steps

You've got Eclipse set up and configured. Now, you can import your project into Eclipse and use the Atlassian SDK with it.

Powered by Confluence and Scroll Viewport