Results 1 to 14 of 14
  1. #1
    Hussain Ali is offline Member
    Join Date
    Feb 2010
    Posts
    37
    Rep Power
    0

    Default want to add Asprise jar file as well as its lib file

    hii every one

    i m trying to read data from an image by using Asprise OCR java
    i m working with eclipse on MAC os x
    but i m getting an run error

    following is the error:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no AspriseOCR in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1809)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1045)
    at com.asprise.util.ocr.OCR.loadLibrary(OCR.java:247)
    at com.asprise.util.ocr.OCR.<init>(OCR.java:56)
    at DisplayImage.<init>(DisplayImage.java:22)
    at DisplayImage.main(DisplayImage.java:38)

    and also how can i get java.library.path in eclipse with MAC os for
    set the path for lib file

    plz reply soon its very important to me
    because i m doing a project for Extracting data from image



    this is my program:


    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.JFrame;

    import com.asprise.util.ocr.OCR;
    public class DisplayImage extends Panel {
    BufferedImage image;
    String s;
    public DisplayImage() {
    try {
    System.out.println(System.getProperty("java.librar y.path"));
    //System.setProperty("java.library.path","/Users/hussainalisyed/Downloads/Asprise-OCR-Java-MacOSX_Intel-4/libAspriseOCR.jnilib") ;
    //System.out.println(System.getProperty("java.librar y.path"));
    System.out.println("Enter image name\n");
    BufferedReader bf=new BufferedReader(new
    InputStreamReader(System.in));
    String imageName=bf.readLine();
    File input = new File(imageName);
    image = ImageIO.read(input);
    s = new OCR().recognizeEverything(image);

    } catch (IOException ie) {
    //System.out.println("Error:"+ie.getMessage());
    //System.out.println(System.getProperty("java.librar y.path"));
    }
    }

    public void paint(Graphics g) {
    g.drawImage( image, 0, 0, null);
    g.drawString(s, 500,500);
    }

    static public void main(String args[]) throws
    Exception {
    JFrame frame = new JFrame("Display image");
    Panel panel = new DisplayImage();
    frame.getContentPane().add(panel);
    frame.setSize(600, 600);
    frame.setVisible(true);
    }
    }

  2. #2
    programmer_007's Avatar
    programmer_007 is offline Senior Member
    Join Date
    Aug 2009
    Posts
    125
    Rep Power
    0

    Default

    when u enter code .. plz surround it by tag ....

  3. #3
    programmer_007's Avatar
    programmer_007 is offline Senior Member
    Join Date
    Aug 2009
    Posts
    125
    Rep Power
    0

    Default

    not PHP tag ..... use
    Java Code:
    actual code

  4. #4
    Hussain Ali is offline Member
    Join Date
    Feb 2010
    Posts
    37
    Rep Power
    0

    Default

    Java Code:
    import java.awt.*; 
    import java.awt.image.BufferedImage; 
    import java.io.*; 
    import javax.imageio.ImageIO; 
    import javax.swing.JFrame; 
    
    import com.asprise.util.ocr.OCR; 
    public class DisplayImage extends Panel { 
    BufferedImage image; 
    String s; 
    public DisplayImage() { 
    try { 
    System.out.println(System.getProperty("java.librar y.path")); 
    //System.setProperty("java.library.path","/Users/hussainalisyed/Downloads/Asprise-OCR-Java-MacOSX_Intel-4/libAspriseOCR.jnilib") ;
    //System.out.println(System.getProperty("java.library.path")); 
    System.out.println("Enter image name\n"); 
    BufferedReader bf=new BufferedReader(new  
    InputStreamReader(System.in)); 
    String imageName=bf.readLine(); 
    File input = new File(imageName); 
    image = ImageIO.read(input); 
    s = new OCR().recognizeEverything(image); 
    
    } catch (IOException ie) { 
    //System.out.println("Error:"+ie.getMessage()); 
    //System.out.println(System.getProperty("java.librar y.path")); 
    } 
    } 
    
    public void paint(Graphics g) { 
    g.drawImage( image, 0, 0, null); 
    g.drawString(s, 500,500); 
    } 
    
    static public void main(String args[]) throws 
    Exception { 
    JFrame frame = new JFrame("Display image"); 
    Panel panel = new DisplayImage(); 
    frame.getContentPane().add(panel); 
    frame.setSize(600, 600); 
    frame.setVisible(true); 
    } 
    }

    syr
    actually i m using this forum first time

    plz reply fast

  5. #5
    Hussain Ali is offline Member
    Join Date
    Feb 2010
    Posts
    37
    Rep Power
    0

    Default

    its urgent

  6. #6
    Hussain Ali is offline Member
    Join Date
    Feb 2010
    Posts
    37
    Rep Power
    0

    Default

    hii every one

    i m trying to read data from an image by using Asprise OCR java
    i m working with eclipse on MAC os x
    but i m getting an run error

    following is the error:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no AspriseOCR in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1809)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1045)
    at com.asprise.util.ocr.OCR.loadLibrary(OCR.java:247)
    at com.asprise.util.ocr.OCR.<init>(OCR.java:56)
    at DisplayImage.<init>(DisplayImage.java:22)
    at DisplayImage.main(DisplayImage.java:38)

    and also how can i get java.library.path in eclipse with MAC os for
    set the path for lib file

    plz reply soon its very important to me
    because i m doing a project for Extracting data from image



    this is my program:

    Java Code:
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.JFrame;
    
    import com.asprise.util.ocr.OCR;
    public class DisplayImage extends Panel {
    BufferedImage image;
    String s;
    public DisplayImage() {
    try {
    System.out.println(System.getProperty("java.librar y.path"));
    //System.setProperty("java.library.path","/Users/hussainalisyed/Downloads/Asprise-OCR-Java-MacOSX_Intel-4/libAspriseOCR.jnilib") ;
    //System.out.println(System.getProperty("java.librar y.path"));
    System.out.println("Enter image name\n");
    BufferedReader bf=new BufferedReader(new 
    InputStreamReader(System.in));
    String imageName=bf.readLine();
    File input = new File(imageName);
    image = ImageIO.read(input);
    s = new OCR().recognizeEverything(image);
    
    } catch (IOException ie) {
    //System.out.println("Error:"+ie.getMessage());
    //System.out.println(System.getProperty("java.librar y.path"));
    }
    }
    
    public void paint(Graphics g) {
    g.drawImage( image, 0, 0, null);
    g.drawString(s, 500,500);
    }
    
    static public void main(String args[]) throws
    Exception {
    JFrame frame = new JFrame("Display image");
    Panel panel = new DisplayImage();
    frame.getContentPane().add(panel);
    frame.setSize(600, 600);
    frame.setVisible(true);
    }
    }

    can any one give fast reply please.

  7. #7
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    You need to load the library using System.load/System.loadLibrary (see the API specs for those methods).

  8. #8
    Hussain Ali is offline Member
    Join Date
    Feb 2010
    Posts
    37
    Rep Power
    0

    Default

    when i use method System.loadLibrary("path")

    then it gives an error like that:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: no libAspriseOCR.jnilib in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1809)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1045)
    at Demo.main(Demo.java:10)


    can u explain me in detail
    how can i fix this

    or


    how can i put libAsproseOCR.jnilid in java.library.path
    in mac os x with IDE Eclipse

  9. #9
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    If you use System.load then you can specify the absolute path of the library.
    You can specify the library path on the command line when starting the application through the -Djava.library.path switch.

  10. #10
    Hussain Ali is offline Member
    Join Date
    Feb 2010
    Posts
    37
    Rep Power
    0

    Default

    no i m using System.loadLibrary("path")

    can u plz tell me
    which path i ve to set for -Djava.library.path

    because when i m setting path of :
    /Users/hussainalisyed/Downloads/Asprise-OCR-Java-MacOSX_Intel-4.0/libAspriseOCR.jnilib

    it gives like that:
    No such file or directory


    Actually i m using Mac os x first time
    i dont know how to set path foe -Djava library.path


    can u plz know me
    i m requesting u.

  11. #11
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Why don't you use System.load? Loading libraries is system dependent anyway.


    If you still want to use System.loadLibrary then all I know is that the unix command is something like
    Java Code:
    % setenv LD_LIBRARY_PATH yourLibrarypath:${LD_LIBRARY_PATH}
    I'm no Mac expert so I can't help you there.

  12. #12
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Another thing, when you use System.loadLibrary, you just provide the name of the library only. Not the path.

  13. #13
    Hussain Ali is offline Member
    Join Date
    Feb 2010
    Posts
    37
    Rep Power
    0

    Default

    thanks for suggestion
    i ve used System.load() this time
    but
    this time it gives error like that:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/hussainalisyed/Downloads/Asprise-OCR-Java-MacOSX_Intel-4.0/libAspriseOCR.jnilib: no suitable image found. Did find: /Users/hussainalisyed/Downloads/Asprise-OCR-Java-MacOSX_Intel-4.0/libAspriseOCR.jnilib: mach-o, but wrong architecture
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1878)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1758)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1020)
    at Demo.main(Demo.java:13)
    can u help me again

  14. #14
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Sorry, I don't know what any of that means. The project pages (and manuals) for those libraries might help.

Similar Threads

  1. Replies: 8
    Last Post: 02-18-2010, 01:54 PM
  2. What is ASPRISE OCR SKD v4.0
    By LankanSniper in forum Advanced Java
    Replies: 2
    Last Post: 03-25-2009, 11:50 AM
  3. Replies: 0
    Last Post: 02-11-2009, 10:53 AM
  4. Replies: 7
    Last Post: 11-19-2008, 03:09 PM
  5. Replies: 7
    Last Post: 05-23-2008, 04:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •