wiki:UsingElckerlycInEclipse

Using Elckerlyc in an Eclipse project

STEP 1: Setting up project structure

First, you need to set up projects in Eclipse for the various modules that you want to compile. The process is slightly different when you work from the source SVN or when you work from the released binaries.

Variant A: Setting up project structure via SVN in Eclipse

If you use the source releases from Elckerlyc, you need to set up SVN in Eclipse, check out the modules from the repository, and make them into an Eclipse project.

  1. Get the svn plugin from  http://subclipse.tigris.org/ and install it
  2. Check out the source repository by hand (using SmartSvn, Tortoise, or any tool of your choice). Typical directory setup when you have checked out the SVN:
    <svnroot>/HmiShared/ant
    <svnroot>/HmiShared/docs
    <svnroot>/HmiShared/repository
    ...etc
    <svnroot>/HmiDemo/MyFirstProject
    <svnroot>/HmiDemo/HmiAnimationDemo
    ...etc
    <svnroot>/Hmi/HmiBml
    <svnroot>/Hmi/HmiAnimation
    ....etc
    
  3. Now you have to create separate Eclipse projects for a selection of the modules that are in SVN. Say, for example, that you want to make an Eclipse project of HmiDemo/MyFirstProject.
    1. In eclipse menu: window->open perspective->other->SVN repository exploring
    2. Click right mouse in the SVN Repository tab, choose "new repository location"
    3. Enter the URL of the repository ( http://hmisvn.ewi.utwente.nl/elckerlyc)
    4. browse through the SVN tree to the project that you want to build in Eclipse (HmiDemo/MyFirstProject)
    5. Right mouse on that module; choose Checkout (again!)
    6. Select as new project configuration using the new project wizard
    7. In the "new project-select a wizard" dialog, select "Java Project" and choose 'next'
    8. In the "new project-create a java project" wizard dialog, uncheck use default location;
    9. as "location" you fill out the directory of the project (in our case, <svnroot>/HmiDemo/MyFirstProject). The project name will be automatically changed (to MyFirstProject)
    10. Press next
    11. set the output folder to MyFirstProject/build/classes
    12. go to the next step to add required libraries to the build path

Variant B: Setting up project structure in Eclipse from the binary release of Elckerlyc

  1. We assume that you have downloaded the Elckerlyc release files, and have a directory structure as follows:
    <projectroot>/HmiShared/ant
    <projectroot>/HmiShared/docs
    <projectroot>/HmiShared/repository
    ...etc
    <projectroot>/HmiDemo/MyFirstProject
    <projectroot>/HmiDemo/HmiAnimationDemo
    ....etc
    
  2. In Eclipse menu: file->new->new java project
  3. In the "new project-create a java project" wizard dialog, uncheck use default location;
  4. as "location" you fill out the directory of the project (in our case, <projectroot>/HmiDemo/MyFirstProject). The project name will be automatically changed (to MyFirstProject)
  5. Press next
  6. set the output folder to MyFirstProject/build/classes
  7. go to the next step to add required libraries to the build path

Variant C: Adding Elckerlyc to your existing Eclipse project

Don't make new project; do the "resolve" step for myfirstproject (see below) --> everything you need is now in myfirstproject/lib copy it to your existing project, add it to the classpath; don't forget lib_ld_path and resourcez (see below) note that several of these libraries are machine or OS dependent --> e.g., to get the set of libraries for a mac64, resolve myfirstproject on a mac64

STEP 2: Set build paths to include dependent libraries

you need the right versions (for your machine and operating system) of all dependent libraries in the project classpath; Elckerlyc contains ant scritps to take care of this.

  1. First, collect right versions of libraries using our ant scripts
    1. command prompt in HmiDemo/MyFirstProject
    2. ant resolve
    3. Now, all required libraries, in the version for your OS and machine, are in HmiDemo/MyFirstProject/lib
  2. Second, add to project classpath in eclipse
    1. in the 'project properties' dialog, go to Java Build Path
    2. In the tab "libraries", add all jar files in HmiDemo/MyFirstProject/lib to the class path of the project

STEP 3: Set build paths to include required resources

Elcekrlyc requires resources such as the data files containing virtual human embodiments or gesture repertoire. In MyFirstProject, these resources are contained in jar files (see previous step). For example, the data files for face animation are in HmiDemo/MyFirstProject/lib/HmiHumanoidFaceControl.jar. Maybe you want to use the source versions of these resources, instead of the released jar, because you want to be able to modify them. Do this as follows (steps are similar for other resource releases):

  1. in the 'project properties' dialog, go to Java Build Path
  2. In the tab "libraries", remove the released jar version of the required resource from the class path of the project (in this case: remove HmiHumanoidFaceControl.jar)
  3. in the tab "libraries", choose "add external class folder"; browse to the right resource directory (in this case: HmiResource/HmiHumanoidFaceControl/resource) and add it.

In addition, you need to add HmiDemo/MyFirstProject/resource as class folder to the project classpath.

STEP 4: set a few virtual machine variables

For running your project, you need to set a few additional settings in "run configuration" dialog for your main class

  1. tab "arguments", VM arguments, add
    -Djava.library.path="lib"
    -Xms128m 
    -Xmx512m  
    -Xss5M
    
  2. add -Dlogback.configurationFile=LogbackConfigs/warnlogstdout.xml or any other config file to specify your logging (see ProgrammingGuidelines)
  3. Add a relative path from you project directory to the proejct root: -Dshared.project.root="../.."

STEP 5: Project dependencies

The above explanation allows you to build one of the HMI modules in Eclipse. If you follow the above instructions, each module depends on a released version of the other modules. It is possible that you want to work on several of these modules at the same time, having each be dependent on the latest source versions of the other modules. You achieve this through the following steps.

  1. in the 'project properties' dialog, go to Java Build Path
  2. In the tab "libraries", remove the released jar version of the required project from the class path of the project
  3. in the tab "projects", add the required project

User contributions

Discussion

If you need more details, or have additional suggestions: post a reply to this message.