Menu

EclipseSetup

Anonymous

Eclipse IDE Setup

This page has instructions on how to create a single JAT project in Eclipse for use with OD Toolbox development. Multiple JAT projects in Eclipse can be created from multiple JAT working copies by repeating these instructions.

These instructions are based upon the ability to share Eclipse project-specific settings amongst team members using source control. This makes project setup simpler and also standardizes JAT build settings on the team. A recent version of Eclipse (e.g. v4.2+, found here) should be used.

References to the JAT external jars location in the working path is handled using an Eclipse classpath variable that each developer will set for their working copy layout. This classpath variable is stored in the developers Eclipse workspace settings and is not checked into source control.

(As of Sep 2012, Eclipse v4.2 was used to create the .project, .classpath, and .settings directory for the JAT /branches/ODTBX repository location. These will need to be updated as Eclipse changes.)

JAT Working Copies

Before we begin, check out the JAT codebase for use with OD Toolbox and its supporting external jars. These locations are found on the [RepositoryInstructions] page.

Eclipse v4.2 Setup

1) Start Eclipse. (If unsure of the workspace selection just use the default.)

2) Import a Project...

  • File Menu -> Import...
  • or, right-click on the Project Explorer background and select Import..., then click Import...

3) Tell Eclipse that this will be an existing project

  • Select Existing Projects into Workspace
    • Note: This option is found underneath General
  • click Next

4) Find the project

  • In the Import Projects dialog box, click Browse for "Select root directory:"
  • Browse over to the top of your JAT working copy (vendors/Jat/).
    • Note: The correct directory is vendors/Jat/, NOT the vendors/Jat/jat/ directory.
    • vendors/Jat/ should contain the following: design/, input/, installer/, jat/, jat.sh, etc.
    • A selection will appear in the Projects box in the dialog if Eclipse found it.
  • Make sure this project is selected, and "Copy projects into workspace" is NOT selected.
  • and click Finish

At this point you should have a JAT project appear in your Project Explorer. The project name may vary. For example, the JAT Subversion repository location at /branches/ODTBX/ has its /branches/ODTBX/.project named Jat_ODTBX_branch.

5) Tell Eclipse where to find the external jars:

  • Bring up the properties for this JAT project. Highlight the project and either:
    • Right-click and select properties, or
    • Press Alt-Enter
  • Select Java Build Path
  • Go to the Libraries tab
  • If you do not see JAT_TOP in the window (the most likely case for a new project):
    • Click Add Variable...
    • Click Configure Variables...
    • In the Classpath Variables dialog box click New...
    • Enter JAT_TOP in the New Variable Entry dialog, then click Folder...
    • Browse to the working copy location of external_jar. Select the directory that contains external_jar!
    • Click OK to close the New Variable Entry dialog.
    • Click OK to close the New Variable Classpath Entry dialog.
    • At this point Eclipse will ask to rebuild the project since the classpath changed. Click Yes to do the build.
    • Finally, click OK to close the project properties dialog.
  • If you do see JAT_TOP in the window:
    • Select JAT_TOP in the window and click Edit...
    • In the Edit Variable Entry dialog that appears, click Variable...
    • In the Variable Selection dialog that appears, click New...
    • In the New Variable Entry dialog that appears, enter JAT_TOP as the Variable Name and click Folder...
    • Browse to the working copy location of external_jar. Select the directory that contains external_jar!
    • Click OK to close the New Variable Entry dialog.
    • Click OK to close the Variable Selection dialog.
    • At this point Eclipse will ask to rebuild the project since the classpath changed. Click Yes to do the build.
    • Click OK to close the Edit Variable Entry dialog.
    • Finally, click OK to close the project properties dialog.

At this point, Eclipse should have built the JAT project. If not, select Project->Build All. Go to the Problems View in Eclipse to see if there were any build errors. (The Problems View is under the Window menu -> Show View -> Problems)

Most likely any build errors are a result of not setting the JAT_TOP variable correctly. Remember, JAT_TOP is not the external_jar directory itself. Make sure that all of the classpath variable entries are correct in the Project's properties: Java Build Path -> Libraries tab. However, occasionally Eclipse doesn't always resolve all of the classpath references with new workspace variables. Close the Eclipse Project, Jat_ODTBX_branch, and then re-open it. If the JAT_TOP location is set correctly the references should be resolved.

Note that although there are many Java compiler warnings for JAT there should be no build errors.

Eclipse Details

The .project file only specifies the project name.

The .classpath file specifies the existence of JAT_TOP and the relative location of all required jars under it. It does not define JAT_TOP.

The .setting directory contains project customizations. Currently, this sets the Java Compiler compliance level to 1.5 for consistency across platforms and the project encoding to UTF-8.

If a developer is going to have multiple JAT working copies then multiple projects can be easily created. Each project (.project file) will have to have a different name before importing into Eclipse. If there are differences in the external jars that JAT depends upon then a different classpath variable than JAT_TOP will have to be modified in the other project(s). This is because JAT_TOP is a workspace variable and applies to all projects.

Simply changing JAT_TOP in the .classpath file and checking it in surprises the other developers and is bad form.


Navigation

[ForDevelopers] - Go back to the main development page

WikiStart - Go back to OD Toolbox Home


Related

Wiki: ForDevelopers
Wiki: Home
Wiki: MatlabEnvSetup
Wiki: OdtbxReleaseProcess
Wiki: RepositoryInstructions

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.