Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

The following are

the

complete instructions for setting up

the

a standard development environment for Java and Open Source projects.

Generally, the

following

instructions assume an MS-Windows based operating system.

Note

that these

: These are recommendations for a complete system. Naturally, you need to tailor these instructions

will need to be tailored if your company uses some other

if you're using a different source code control system

other than

from Subversion (for example).

Include Page
Prerequisites
Prerequisites

On this page:

Table of Contents
maxLevel1

Anchor
InstallEclipse
InstallEclipse

Install Java JDK

The version of Java you should use depends on the Aspire version you are targeting to:

  • Aspire 3 and up requires to run at Java 1.7 and above.
Tip
We recommend installing the Java JDK (Java Development Kit), just in case you want to create your own Aspire components/applications in the future. But only the JRE (Java Runtime Environment) is absolutely required.
  1. Image RemovedDownload and install the latest version of the Java JDK appropriate for the system that will run Aspire:http://java.com/en/download/manual.jsp

    1. If you have a 64 bit machine, we recommend installing the 64 bit version of Java. That will allow you to create large-memory instances of Aspire.
      1. The Aspire framework itself does not use up that much memory (100mb or so). But some applications may store big hash tables to improve performance, so it's best to have the 64 bit JVM (Java Virtual Machine), just in case you need it someday.
  2. Test that you can access the "java" command from your console.
    1. Open up a new DOS command-shell (go to the start menu, and enter "cmd" where it says "Run" or "Search for Programs", and then execute the cmd.exe program).
    2. At the prompt, enter the following, then press the Enter key: java -version

    3. Success is indicated when version information is returned.

      Image Removed
  3. Add the "JAVA_HOME" environment variable.
    1. This is needed by the Maven command-line tool described below.
      1. Open up your control panel
      2. Go to the "System" control panel (may be inside the 'System and Security' category)
      3. Open up the "Advanced System Settings"
      4. Go to the "Advanced" tab (may already be selected)
      5. Click on "Environment Variables"
      6. Click on "New..."
      7. Enter "JAVA_HOME" as the "Variable name:"
      8. Locate the directory within your Program files where java was installed. Enter this directory name as the "Variable value:"

 

Code Block
> java -version
  java version "1.7.0_79"
  Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
  Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

Install Maven Command Line

Installing the Maven command line is a very useful way to work with Maven and projects, especially for distributions, or when you're having trouble with m2eclipse (which happens now and then).

Image Removed

Download and install the latest version of Apache Maven: http://maven.apache.org/download.html
  • Download the compressed binary files.
  • Suggestion: Create a "C:\dev" directory and unpack the files there.
  • "C:\dev" is a good place to store open source tools like Apache Maven, since (on rare occasions) they will not work with path names that have spaces in them.
    Add the M2_HOME and M2 environment variables in your System Properties and modify your Path variable:
  • Please refer to Step 1 above for the instructions on accessing your Environment Variables via the Control Panel.
  • Add the M2_HOME system variable:
    1. In the System Variables section, click on "New..."
    2. Enter the following in the "Variable name:" field: M2_HOME
    3. Locate the directory within your Program files where you unpacked Maven, enter this directory name as the "Variable value:" (for example, C:\dev\apache-maven-3.3.9), then click on the OK button.
  • Add the M2 system variable:
    1. In the System Variables section, again click on "New..."
    2. Enter the following in the "Variable name:" field: M2Image Removed
    3. In the "Variable value:" field, enter the following, then click on the OK button:  %M2_HOME%\bin
  • Modify your Path variable:
    1. Scroll through the System Variables to locate the Path variable, select it, then click on the Edit button.
    2. Click in the "Variable Value" field to activate it, then press your End key to move your cursor to the end of the value.
    3. Without typing any spaces, enter the the "bin" directory from Apache Maven to your environment path (for example, ;C:\dev\apache-maven-3.3.9\bin), then click on the OK button.
  • Click on the OK button to close the Environment Variables window, then click on the OK button to close the System Properties window.
    Test that you can access Maven.
  • Open up a new DOS command-shell (go to the Start menu, enter "cmd" in the "Run" or "Search for Programs" field, and then execute the cmd.exe program).
  • At the prompt, enter the following, then press the Enter key: mvn -version
  • Success is indicated when version information is returned, as shown in the image to the right.

    Image Removed

    Code Block
    > mvn -v
      Apache Maven 3.1.1 (r755702; 2009-03-18 15:10:27-0400)
      Java version: 1.7.0_79
      Java home: C:\dev\jdk1.7.0_79\jre
      Default locale: en_US, platform encoding: Cp1252
      OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

     

    For detailed steps, please refer to Step 2 of the Aspire Quick Start with Distribution Archetype tutorial.

    Install Eclipse


    1. Go to http://www.eclipse.org/downloads/ and install the latest version of Eclipse IDE for Java Developers.
      • Take care Make sure that your 32/64 bit choice matches the Java JDK you installed (or else Eclipse will fail to start with a JVM error of -1).
    2. Unzip it to the folder of your choice.
    3. Execute Eclipse.
      • Specify a folder where your workspace will be located (can be anywhere).
    4. Check to make sure your Eclipse is using the correct JDK version:
      1. Start Eclipse.
      2. Open Menu: Window/Preferences
      3. Go to Java/Installed JREs.
      4. Check that Java 6 (or later) is installed and selected.
        • Must specify the JDK 1.7 (not a JRE) AND select it; if not, add the new VM and then select it as the default.
        • This is required so that new Maven projects will build correctly.
        • When creating new Java projects, make sure that your JRE choice is "Use default JRE", which should be pointing to your JDK.
    5. Install the "Aspire Coding Profile" for Aspire coding standards: media:Aspire_Java_Coding_Profile.xml
      1. Open up Window / Preferences.
      2. Go to Java / Code Style / Formatter.
      3. Click "Import..."
      4. Locate the "Aspire Java Coding Profile.xml" file.
      5. Click "Apply".
        • All this does is set the indentation to 2 spaces (no other coding style issues are important).

    Install

    subversion

    Subversion into Eclipse

    1. Inside eclipse, go to: Help / Install New Software...
    2. Under "Work with:" enter:
    3. Mark all checkboxes and click Next.
    4. Review items and click Next.
    5. Accept the license, click Finish, and let it install.
    6. Restart Eclipse.
    7. Create a new SVN Repository Location by going to Window / Open Perspective / Other… and selecting SVN Repository Explorer.
    8. Right click inside the SVN Repositories window and select New / Repository Location.
    9. Enter the URL of your SVN repository as the "Url" and click Finish.
    10. The application will try to connect; if it connects successfully, you will be prompted for user and password (check the box to avoid being asked to login several times).
      • Search Technologies' employees should use their standard Search Technologies username and password.

    Are you using a 64-bit JVM for Eclipse?

    • You may see "JavaHL" missing library errors when you go to your Subversion repository.
    • If this is the case, you may need to install a 64-bit version of "JavaHL". Go to http://www.sliksvn.com/en/download and download and install the "SlikSVN" 64-bit Windows subversion client. It should put the SlikSVN binaries on your Windows PATH environment variable (check this). Then restart Eclipse and you should be fine.
    • See http://subclipse.tigris.org/wiki/JavaHL for more details.

    Anchor
    InstallMaven
    InstallMaven
    Install Maven

    Into

    into Eclipse (m2eclipse)

    Note

    Not need it by Eclipse Mars (4.5) and above

    Install the plugin:

    1. Go to Help / Install New Software...
    2. Under "Work with" enter:
    3. Click to install the following items:
      1. Maven Integration (the whole thing)
    4. Click Next/Finish/Accept/Restart as necessary to complete the installation.
    5. Set Eclipse to use the jdk1.7.0_xx (this is recommended by m2eclipse):
    6. Edit the "eclipse.ini" file located in your eclipse directory.
      1. Add the following two lines to the top of the file:
        1. -vm
        2. C:\Program Files\Java\jdk1.7.0_xx\bin
        3. (specify the exact location of your JDK-7 binary)

    To test that m2eclipse is working correctly:

    1. Restart Eclipse.
    2. Open up the console window: Menu: Window / Show View / Console
    3. Look for the open-console toolbar (the console with a + sign), then select "Maven Console."
    4. Make sure there are no errors (any errors will be shown in red).
    5. Wait for it to download the maven repository index.

    Optional (install additional plugins):

    1. Return to Help / Install New Software...
    2. After the "Work with:" prompt, enter: http://m2eclipse.sonatype.org/sites/archives/m2e-extras-20101029/
    3. Click to install the following items:
      1. Maven Optional Components / Maven SCM handler for Subclipse
      2. Maven Optional Components / Maven issue tracking configurator for Mylyn 3.x
      3. Maven Project Configurators / WTP

    In order to get Maven to Run inside Eclipse, you will need to change the JRE to JDK 1.7 or 1.8 as appropriate according to your Aspire target version:

    1. Window / Preferences
    2. Java / Installed JREs
    3. Add...
    4. "Standard VM"
    5. Click "Directory...", then locate your JDK folder, click on the JDK folder and then hit OK & Finish
    6. Back in the "Installed JREs" dialog, make sure your JDK is selected.
    7. Click OK.

    Anchor
    InstallCygwin
    InstallCygwin
    Install Cygwin with Subversion Command-Line (Optional)


    If you are running in Windows, then Cygwin is an extremely valuable tool for managing very large files.

    1. Go to http://www.cygwin.com/ and install the Cygwin setup.exe program
    2. Run the setup.exe program, then follow the instructions.
      • Install cygwin into C:\cygwin.
      • Make sure that Subversion is selected when installing packages.
        • In the 'Devel' category, make sure that "subversion: A version control system" is selected.
    3. Once installed, add the following environment variables to your Windows environment:
      • Go to Control Panel / System / Advanced System Settings / Environment Variables...
      • Add variables for:
        • CYGWIN => nodosfilewarning
        • Add ";C:\cygwin\bin" to the end of your PATH variable.
          • This will allow all cygwin commands to be executed directly from DOS Command windows.