Aspose.BarCode for Java could not find the license on Linux

We use aspose-barcode-8.2.0.jar on windows and linux. The license file Aspose.BarCode.Java.lic is copied into the WEB-INF/lib where also the jar file is located. The license file is 30 day trial license.


When the barcode is recognized or created with setting the license with the following statements:

<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>com.aspose.barcode.License license = new com.aspose.barcode.License();
license.setLicense(“Aspose.BarCode.Java.lic”);
<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>
<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>The following exception is thrown:
java.lang.Exception: Failed to set license. Details: Cannot find license ‘Aspose.BarCode.Java.lic’.
This exception happens on linux only, on windows it works fine. Also in the same tomcat (on linux) also Aspose 
Words is used and there the license is set without problem. 
Hi Martin,

Thank you for your inquiry.

This is to update you that we have looked into the issue. Initially we can say that it is not a bug. Path on Linux systems differs from the paths on Windows. WEB-INF/lib directory is not publicly available, so it is suggested to put the license files into the folder which is mentioned in PATH variable of the system configuration [like we use to do in windows – environment variables] OR mention correct path in the statement:

license.setLicense("Aspose.BarCode.Java.lic");

From the exception message it can be seen that that WEB-INF/lib path was not taken into account. In order to confirm, please try to paste Aspose.BarCode.Java.lic file in the folder where the main executable file is located instead of WEB-INF/lib directory.

Please try the above at your end. Feel free to contact us in case of any query or comments.

Thanks a lot. Adding the path did the trick.