ImageGear for Java
Building the Core Sample with Eclipse

This section will walk through the process of building the ImageGear for Java Core sample. Eclipse IDE 1.4.1 is used, but this tutorial may provide guidance for building with other versions of Eclipse.

Create User Library

First, we will set up a User Library containing all ImageGear for Java JAR files. This is not required but is helpful when building multiple samples.

  1. Select Window > Preferences to open up the Preferences window. Then navigate to the Java > Build Path > User Libraries panel. Within the User Libraries panel, click the New button.


  2. Give the new library the name "ImageGearJava" and click OK.


  3. Back in the User Libraries panel, select the new library and click Add JARs.

  4. In the JAR Selection dialog, browse to the lib folder within the ImageGear for Java installation directory. Select all *.jar files in the lib folder. If you know that you will not need some of the JAR files, then they don't have to be selected.


  5. Click Open to accept the JAR files you have selected. Then in the Preferences window, click OK to exit.

Create the Sample Project

In this section we will create a project for the Core sample application. This sample will use the Shared sample, but we will not build the Shared sample, instead we will use the pre-built imagegear2.shared.jar that installs with ImageGear for Java.

  1. Select File > New > Java Project to open the New Java Project dialog. Give the project a name, "igsample.core", and select an appropriate project location.


  2. Click Next.

    Now the Java Settings page will be displayed. Select the Source tab and in the tree right click on the igsample.core node and click "Link Source".

  3. Select the Linked folder location as the folder containing the source code for the Core project that has been installed into the samples folder within the ImageGear for Java installation directory. It is best to select the src folder, at "[IG Java install path]\samples\Core\src\" so that the package naming is maintained.


  4. Change the folder name to something other than src, for example use "coresrc". Click Finish to return to the Java Settings page.

  5. Next select the Libraries tab on the Java Settings page.

  6. Add the ImageGearJava user library that we created at the beginning of this tutorial but clicking the Add Library button. In the Add Library dialog, specify that you want to add a User Library and click Next. Then check the ImageGearJava library and click Finish.


  7. Then, add the imagegear2.shared.jar. Click the Add External JARs button and navigate to the samples folder within the ImageGear for Java install directory. Select the imagegear2.shared.jar and click Open.


  8. Now, exit the New Java Project dialog by clicking the Finish button.

    The Package Explorer in the Eclipse IDE should now contain the igsample.core project, and the project tree should contain the files in the com.imagegear.core source package, the ImageGearJava User Library, and the imagegear2.shared.jar, like shown in the image below.


  9. Now we'll create a launch configuration for the application. Open the Properties dialog for the project (File > Properties) and then select the Run/Debug Settings page.

  10. Click the New button, select the Java Application configuration, and then click OK.


  11. This brings you to the Edit Configuration dialog. Under the Main tab, we need to specify a main class. Click the "Search" button to bring up the Select Main Type dialog. Select the ImageViewerUI class and click "OK".


  12. Click OK to close the Edit Configuration dialog, and again click OK to clise the project's Properties dialog.

  13. If you're building the sample on a Linux or Mac OS X machine, you can skip to building and running the application. However, if you're working on a Windows machine you will now need to set the path to the native libraries (for JPEG2K and PDF support), refer to Setting the Path to the Native Libraries for instructions.

  14. You can now build the project (Ctrl-B, if automatic building is disabled) and run (Ctrl-F11).
    If you have any compile-time or run-time errors, retrace your steps to determine if something was configured differently from the instructions in this walk-through.
    For help resolving runtime issues see the Warnings and Errors section of the ImageGear for Java User Guide If you cannot resolve an issue, you may contact Accusoft's Support department for more help.

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback