ImageGear for Java
Setting the Path to the Native Libraries
The paths mentioned here are for Windows. They will vary in other operating systems.

Licensing (enforcement) code in ImageGear for Java reads licenses from files. These license files are installed to the config folder by the Accusoft License Client; normally this utility is run at the end of installation. If you keep the installation folder structure intact and load the SDK jars from their lib folder, the licensing code will find the license files in the config folder on its own, when it needs to authorize the application to execute various features of the SDK (for example, when calling the ImGearCommonFormats.Initialize method).

If, however, you need to move either the SDK jars, the license files, or both, so that they no longer have the same parent, you must tell the ImageGear for Java licensing code where the license files are. This can be done by setting the environment variable IMAGE_GEAR_LICENSE_DIR to have the value of the directory containing the license files. If license files are not found in this directory or this envrionment variable is not set, then the licensing code will default to looking in the path relative to the lib folder.

License files use the naming convention "accusoft.<solution name>.imagegear", where <solution name>=""> has the same string value as the argument to the ImGearLicense.SetSolutionName method. For evaluation and development licenses, the solution name will be "AccuSoft 21-33-2" or "AccuSoft 21-32-2" depending on whether the license is for a 64- or 32-bit environment.

The Windows version of ImageGear for Java may need to use native libraries that are installed in the bin folder. If you keep the installation folder structure intact and load the SDK jars from their lib folder, they will find the dlls in their peer bin folder on their own, at the time the ImGearLicense class is loaded. (For example, when calling ImGearLicense.SetSolutionName()).

If, however, you need to move either the jars, the entire contents of bin, or both, so that they no longer have the same parent, you must tell the SDK jars where the dlls are. There are several ways to do this without the SDK jars first looking for a peer bin folder. To communicate the location programmatically, call ImGearNativePath.setPath(<String value of fully qualified path to native libraries>) before the ImGearLicense class is loaded (which kicks off an automatic search) or afterwards, if the automatic search has not already found them.

The automatic search will first determine the architecture running the Java Virtual Machine, and look for the environment variable, IMAGE_GEAR_64BIT_PATH on 64 bits, and IMAGE_GEAR_32BIT_PATH on 32 bits, for fully qualified paths to the libraries. If the variable does not exist, it looks in the components of the java.library.path System property. You can set this property to contain the path to the native libraries in two ways:

  1. adding the path to the operating system's path environment variable

    Setting the operating system's path this way will prevent you from using the 32 and 64 bit SDKs simultaneously, since it will always find the version that is first.

  2. invoking the Java Virtual Machine with the argument -Djava.library.path=<path to="" native="" binaries>="">

The last place it looks is in a bin peer folder of the one the SDK jars were loaded from.

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback