Use this task to import and use the ObjectGrid sample application
in Eclipse.
About this task
By using Eclipse, you can easily debug your applications. You can
perform a step-by-step walk through of the sample application.
Procedure
- Import the project into Eclipse:
- Run the Eclipse program. Use the eclipse.exe file
in the Eclipse installation directory.
- Using Eclipse, create a new project.
- Click File > New > Project > Java > Java Project. Click Next.
- Type a project name. For example, type ObjectGridSamples.
- Select Create new project in workspace.
- In the Project Layout section, click Configure default.
- For the source and output folder, select Project and click OK.
- Click Next.
- Click the Libraries tab.
- Click Add External JARs.
- Navigate to the /ObjectGrid/lib folder and select the objectgrid.jar, asm.jar,
and cglib.jar files. Click Open in the JAR selection wizard.
- Click Finish.
- Import the objectgridSamples.jar file into the Java Project.
- Right-click on the Java project and select Import.
- Select Zip file under Select an import source.
- Click Next.
- Click Browse to open the Import From Zip File wizard.
- Open the objectgridSamples.jar file. Navigate
to the /ObjectGrid/samples directory. Select the objectgridSamples.jar file
and click Open.
- Verify that the check box of the root file tree is selected.
- Verify that the Into folder contains the Java project
that you created in the previous step, for example, the ObjectGridSamples project.
- Click Finish.
- Check the properties of the Java Project.
- Open the Java Perspective. Click Window > Open Perspective
> Java.
- Go to the console view. Click Window > Show view > Console.
- Verify that the Package Explorer view is available and selected.
Click Window > Show View > Package Explorer.
- Right-click on the Java project and select Properties.
- Click Java Build Path on the left panel.
- Click the Source tab in the right panel.
- Verify that the project root is listed in the Source folders
on the Build path panel.
- Click the Libraries tab in the right panel.
- Verify that the objectgrid.jar, asm.jar, and cglib.jar files
and a JRE System Library are listed in the JAR and class folders on the Build
path panel.
- Click OK.
- Run the ObjectGrid sample.
- From the Package Explorer view, expand the Java project.
- Expand the com.ibm.websphere.samples.objectgrid.basic package.
- Right-click on the ObjectGridSample.java file. Click Run
> Java Application.
- The console displays similar output to when you run the application
on the Java command line. For an example of the output, see Running the ObjectGrid sample application on the command
line.
Run the distributed ObjectGrid sample.
To run the distributed ObjectGrid sample, you must configure an ObjectGrid
cluster. For running this sample, you can use the predefined XML configuration
files that are provided in the objectgridSamples.jar file.
See Starting the standalone sample
ObjectGrid cluster for more information. After the ObjectGrid
server is started, you can run the distributed ObjectGrid sample application
with the following steps:
- From the Package Explorer view, expand the Java project.
- Expand the com.ibm.websphere.samples.objectgrid.distributed
package.
- Right-click on the DistributedObjectGridSample.java file.
Click Run > Java Application.
- The console displays output that is similar to the ObjectGrid
sample.
What to do next
The steps to load the project and run the debugger are also in the SamplesGuide.htm file.
The SamplesGuide.htm file is in the doc directory in the objectgridSamples.jar file.