Preparing Eclipse IDE to work with Gen Studio
This paper disuses some basic techniques how to set Eclipse IDE for all who would like to start developing applications using JMMI a new interface to access Gen local models. You will be able to develop simple command line based Java applications or more complex plug-ins for the Gen Studio. This paper offers some tips in case you run into the problems with correct setting development environment.
How to chose version of Eclipse
Currently Gen Studio released with the Gen 8.0 uses Eclipse 3.4.0 relatively old version of the Eclipse. Version 3.4.0 (classic edition) is still available for the downloads at the following location:
You need to be aware that Gen Studio provides its plug-ins and is using plug-ins coming from the third-party companies. All of them need to be copied to your Eclipse plugin directory. Building such development environment can be a frustrating process because your IDE must have exactly version of the plug-ins used by the Gen Studio. Eclipse checks during startup if all dependences have correct versions and number error messages can be produced in the Eclipse logs. Some of version conflicts can cause that Gen Studio will not start or function correctly.
This paper proposes to use latest version of the Eclipse IDE known as an Indigo. It provides most recent features helping during development process. You can download classic edition from the following location:
Eclipse Classic 3.7 offers a basic functionality required by the developers. You can always add some additional functionality or features later when required.
Accessing JMMI from Java Application
Developing Java applications using JMMI in the Eclipse IDE is quite simple. You need your project having Java nature where is located jar file with the JMMI implementation. Here is how to do it.
Step 1.Let say that project gen.utilities.example is using JMMI interface to access model on the local workstation.
You need to highlight project and right-click. You will see popup menu. Select Properties. It will display Properties dialog box. Click on Java Build Path on the right pane to display Java Build Path. Click on tab Libraries. You can notice that only standard JRE library is visible.
Step 2.We need to add one of the jar files from the Gen Studio plugin subdirectory. Click on Add External JARs… . It will open Browser allowing finding required jar file.
Find com.ca.gen.jmmi_xxxxxxx.jar file. It should be in the following subdirectory:
C:\Program Files (x86)\CA\Gen r8\Gen\GenStudio\plugins
Click Open and you should have all required classes to successfully build your application after clicking OK.
Define Target Platform
You need define Target Platform if you are planning to develop and test your plug-ins for the Gen Studio. The Target Platform refers to the plug-ins, which your workspace will be built and run against. It describes the platform that you are developing for. We need to define platform that includes plug-ins from the Gen Studio. When developing our plug-ins the defined target platform will be selected as an active one and will be used in determining what plug-ins to add to the state.
Target definitions can be created and edited using the Target Definition Content Wizard. Here is explained step-by-step how to do it.
Step1. Open Preferences from the Window menu. Expand Plug-in Developmentand click on Target Platform. You will see that currently Running Platform is active target platform.
Step 2. We need to add a new Target Definition. Press Add… to invoke New Target Definition Wizard. First dialog box asking how to initialise the target definition is displayed.
Step 3.We start with empty target definition so select Nothing and press Next. It will open Target Content dialog box.
Step 4.You will find that list of locations used to collect plug-ins for our target definition is empty. Start with giving some name for a new target. It could be for example Gen Studio. Next press Add… button to open dialog box allowing defining location where Gen Studio plug-ins are located.
Step 5.There are many possible sources of the plug-ins. We are going to select Directorysince Gen Toolset is installed on the same workstation. Press Next to continue. It will open dialog box allowing specifying directory where subdirectory pluginis located with all plug-ins used by the Gen Studio. Here is an example of the directory in case of standard Toolset installation.
C:\Program Files (x86)\CA\Gen r8\Gen\GenStudio
Press Finish to complete. You will see that Target Contents shows a new location and 213 plug-ins are available. Click on Content tab. List of plug-ins is displayed.
There is bug detected in one of the plug-ins causing that projects using this target environment cannot be built successfully. You need to unselect this plug-in. Its name is com.ca.gen.studio.emf.common.
Step 6.Press Finish to complete wizard. You will see that Target Platform has a new Gen Studio target definition. Select a new target, press Apply and click OK. All your projects will be rebuilt using plug-ins from the new target definition.