Eclipse Configuration details

From GEANT2-JRA1 Wiki

Contents

Using CVS

To download sources from perfSONAR cvs

 (1.a) Switch to CVS Repository Exploring Perspective (Windows Menu) 
(1.b) Add perfSONAR repository as a new repository if it does not exist.

(1.c) From the New Menu, Choose "Checkout Projects from CVS" option (usually under New > Other > CVS)
(1.d) Choose the perfSONAR repository, click on Next
(1.e) Choose "Use an existing module" option. This will allow browsing CVS content
(1.f) Find "sonar" module. There is a duplicate sonar entry which does not have any content. Ignore this and choose the one that has content
(1.g) Click on "sonar" module and click Next
(1.h) You should see a "Check Out as" menu. Select "Check out as a project configured using the New Project Wizard". Click on Next
(1.i) In the next window, select "Head" under matching tags and click on Finish. This will next open New Project Wizard

(1.i.1) In New Project Wizard window, choose "Java Project". Click on Next
(1.i.2) In the "Create a Java project" menu,
(1.i.3) Provide a new project name (for Example: JRA1)
(1.i.4) Choose Java compliance as 5. Not doing this now is fine as it can be changed later
(1.i.5) Project Layout: Select separate source and output folders
(1.i.5) Click on Finish. Download will begin. The time required to download depends on network connectivity.

(1.j) Continue with configuring the Build Path

Using SVN

To configure SVN repository into Eclipse

  (2.a) Switch to SVN Repository Exploring Perspective (You can only see this after you have installed the svn plugin for eclipse)
(2.b) Click on the Add new SVN Repository icon
(2.c) In the Add SVN Repository dialogue box, type the URL value as below:
(2.c.1) https://svn.internet2.edu/svn/perfsonar - This will let you browse through all branches and versions of perfSONAR code base
(2.c.2) https://svn.internet2.edu/svn/nmwg/trunk/nmwg/java/org/ggf - This will let you browse through GGF NMWG code
(2.c.3) You need both the repository locations above. It is hence recommended to create two repository locations in eclipse using the URLs above
(2.c.4) When you have entered the URL in the dialogue box, Click on Finish

To download sources from perfSONAR SVN

  (3.a) Click on the SVN repository for perfSONAR. Click on the + sign next to it. 
    This should allow you to browse through all the branches and trunks. 
    Assuming that you want the trunk code, choose on the + sign next to the trunk. 
    You should see the perfsonar  directory inside trunk. 
    Right click on it, from the right-click menu, choose Checkout

  (3.b) You should now see the Checkout from SVN dialogue box.
    Choose the New Project Wizard option in this window. Click on Finish

  (3.c) You should now see the New Project dialogue box. 
    Choose the Java Project Wizard in the selection window. Click on Next
 
  (3.d) You should now see the New Java Project dialogue box 
  (3.d.1) Choose a project name (I have chosen the name as perfSONAR)
  (3.d.2) Under contents, choose New Project in Workspace
  (3.d.3) Under JDK Compliance choose 5.0 (if you don't see 5.0, you will need go to configure defaults and add JRE there)
  (3.d.4) Under Project Layout it is recommended that you choose Create separate source and output folders
  (3.d.5) This example might help you in understanding these steps easily.
  (3.d.5) Click on Next 

  (3.e) You should now see the next stage of New Java Project dialogue box
  (3.e.1) It is recommended that you check Allow output folders for source folders checkbox 
  (3.e.2) It is recommended that you change Default Output folder value to perfSONAR/build (instead of perfSONAR/bin)
  (3.e.3) This  example screenshot might help you in understanding these steps.
  (3.e.3) Click on finish 
  (3.e.4) Confirm the overwrite (if asked)
  (3.e.5) It usually takes a while to checkout the project

  (3.f) Using ant to download jars
  (3.f.1)

Configuring Build Path

There are two main steps to configuring your build path. The first one is to download required libraries and the second one is to actually configure eclipse.

Downloading libraries

Each service development requires a set of libraries (jar files) that can either be downloaded automatically (if the developer has written ant targets to do so) or will have to be done manually. If ant targets are provided to download jar files, you can run these targets in eclipse - see instructions below. If not, see the instructions to do the same manually.

Using ant targets to download required libraries

        Please NOTE: We have noticed that this procedure does not always work with eclipse. For some reason
        the ant build file (step 2 below) is not accepted by eclipse. In such cases, please revert to the manual procedure below.         

   (4.a.1) Firstly, open the Ant view. For this, you need to be in the Java perspective.
           Then click on Window --> Show view --> Ant.
           Doing this will open an 'Ant' window on the right hand side of the eclipse window. 
           See screenshot for an illustration
 
   (4.a.2) Select the build file for your project. All build files are present in the ant directory.
           Either drag the build file into the Ant view window or click on 'Add Buildfiles' in the Ant View window
           See screenshot for an illustration.

   (4.a.3) Find out which ant targets download the required libraries for the particular service that you are interested in. 
           You can do so by either contacting the developer or by checking the ant directory for that particular service.
         
   (4.a.4) Right click on the particular ant target --> Choose 'Run As' --> 
           This screenshot shows that ant downloaded required jar files.
        

Manually downloading required libraries

   (4.b.1) The easiest way to do this is by checking out 'jar-repository' from svn/perfsonar/trunk (see step:5 below).
           You could also do the same by getting a list of all the required jar libraries from the developer and 
           downloading each of them from either maven or somewhere else onto a known location
           on your hard disk. 

Configuring your buildpath

If you successfully downloaded the lib files using given ant targets follow all the steps under 4.c.
If you manually downloaded the lib by making use of jar-repository, follow steps under 4.d.
If you manually downloaded all the required jars from maven or someplace else, follow steps under 4.e.

Buildpath when jar files are downloaded using ant

  (4.c.1) Right-click on project name (ex: perfSONAR) in the Package Explorer window (in Java Perspective). 
        Choose Properties

  (4.c.2) In the left window of the dialogue box, click on Java Build Path
  (4.c.3) Choose the Source Tab. Make sure your configuration dialogue box resemebles the example screenshot show here
  (4.c.4) Choose the Libraries Tab. Click on Add Jars.... 
          Choose all the jars in the lib directory (and sub-directories in lib) under your assigned project name (perfSONAR) 
          and add them all. See example here
  (4.c.5) Make sure your Java Library - JRE System Library [JDK1.5] is not removed

  (4.c.6) At this point in time, Eclipse should clear all errors in the project src folder (at least related to your service)
          The project is now ready for further development 

Buildpath when jar files in jar repository are being used

  (4.d.1) Right-click on project name (ex: perfSONAR) in the Package Explorer window (in Java Perspective). 
        Choose Properties

  (4.d.2) In the left window of the dialogue box, click on Java Build Path
  (4.d.3) Choose the Source Tab. Make sure your configuration dialogue box resemebles the example screenshot show here
  (4.d.4) Choose the Libraries Tab. Click on Add Jars.... 
          Either choose all the jars in the lib directory (and sub-directories in lib) under the the assigned project name 
          for jar-repository or if you have a list of jars for the particular service, choose them and then add them all. 
          See example here
  (4.d.5) Make sure your Java Library - JRE System Library [JDK1.5] is not removed

  (4.d.6) At this point in time, Eclipse should clear all errors in the project src folder (at least related to your service)
          The project is now ready for further development 

Buildpath when jar files in some location on hard drive are being used

  (4.e.1) Right-click on project name (ex: perfSONAR) in the Package Explorer window (in Java Perspective). 
        Choose Properties

  (4.e.2) In the left window of the dialogue box, click on Java Build Path
  (4.e.3) Choose the Source Tab. Make sure your configuration dialogue box resemebles the example screenshot show here
  (4.e.4) Choose the Libraries Tab. Click on Add External Jars.... 
          Browse to the directory on your hard disk where you have downloaded the required jar files. 
          Choose them all and click on Open. See example here
  (4.e.5) Make sure your Java Library - JRE System Library [JDK1.5] is not removed

  (4.e.6) At this point in time, Eclipse should clear all errors in the project src folder (at least related to your service)
          The project is now ready for further development 

Downloading jar-repository

You might need to work with the jar repository sometimes (either to configure your build path or to add new jar files). To be able to do this, you first need to check out the jar repository from svn. The following steps help you in doing this.

  (5.a) In the SVN Repository Exploring perspective', click on the SVN repository for perfSONAR. 
  (5.a.1)  Click on the + sign next to it. 
  (5.a.2)  This should allow you to browse through all the branches and trunks. 
           Assuming that you want the trunk code, choose on the + sign next to the trunk. 
           You should see the jar-repository  directory inside trunk. 
           Right click on it, from the right-click menu, choose Checkout 
(5.a.3) You will be asked to enter a name for the project. I have chosen the name perfSONAR-lib. (5.a.4) Press finish

Downloading the Message Object (NMWG code)

  (x.a) In the SVN Repository Exploring perspective, click on the SVN repository for NMWG. 
  (x.a.1)  Click on the + sign next to it. 
  (x.a.2)  This should allow you to browse through all the branches and trunks. 
           Assuming that you want the trunk code, choose on the + sign next to the trunk. 
           You should see the nmwg  directory inside trunk.
  (x.a.4)  Right click on the nmwg directory, from the right-click menu, choose Checkout
  (x.a.5)  Choose the New Project Wizard option and click on Finish
  (x.a.6)  You should now see the New Project dialogue box.I have chosen the name perfSONAR-NMWG
  (x.a.7)  Press finish



Back to Developer Information Page

Personal tools