OCR for java

Hi Mr. Babar Raza

I am using Aspose.OCR for Java 2.0.0& Resource file for Aspose.OCR for Java 2.0.0

I am writing this code in my java application.

import java.io.FileInputStream;
import java.io.FileNotFoundException;

import com.aspose.ocr.ILanguage;
import com.aspose.ocr.ImageStream;
import com.aspose.ocr.Language;
import com.aspose.ocr.OcrEngine;
public class OCRapp {


public static void main(String[] args) {
OcrEngine engine = new OcrEngine();

String imageFile = “E:\destName.bmp”;
String resource = “E:\Aspose.OCR.2.0.0.Resources”;
try {

engine.setResource(new FileInputStream(resource));
engine.setImage(ImageStream.fromFile(imageFile));

} catch (FileNotFoundException f) {
System.out.println(f.getMessage());
}

ILanguage language = Language.load(“English”);
engine.getLanguages().addLanguage(language);
engine.process();
System.out.println(engine.getText());


}

}

and I am getting this errors:
C:\Users\Rabih\Documents\Aspose.OCR.Resources (Access is denied)
Exception in thread “main” com.aspose.ocr.OcrException: Stream with resource file is empty or damaged. Please initialize resource file manualy.
at com.aspose.ocr.OcrEngine.process(Unknown Source)
at ocrapp.OCRapp.main(OCRapp.java:41)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

Hi El,

I thought I have already addressed your concerns [2.4.0](https://forum.aspose.com/t/1731) at the moment. In case you wish to keep using your current version of the API then please download the resource archive (that corresponds to your current version of the API) again as it seems from the exception message that the your current archive is somehow corrupted. Once you have downloaded the archive, please place it anywhere but C drive as we have observed that the users who do not have administrative privileges on their machines seldom face access rights on folders in C drive.

Please feel free to get in touch if you face any difficulty or have more questions for us.