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

    Default getting an error Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/hu

    hii every one
    I m using Eclipse IDE with MAC os x

    i m trying to extract data from image
    here i m using ASPRISE OCR LIBRARIES FOR THAT PURPOSE
    when i compile that program with eclipse as well as with terminal
    it compile well but when i tyring to run this it gives an error in eclipse like

    EException 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)

    In terminal it gives an error like that

    Exception in thread "main" java.lang.NoClassDefFoundError: Demo
    Caused by: java.lang.ClassNotFoundException: Demo
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 19)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:330)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 54)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:399)


    can any body
    tell me in detail plz
    because i m new with eclipse as well as mac os x

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

    Default

    here is the code i m using for that
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import com.asprise.util.ocr.OCR;

    public class Demo {
    public static void main(String[] args) throws IOException {
    //System.out.println(System.getProperty("java.librar y.path"));
    //System.setProperty("java.library.path","/Users/hussainalisyed/Downloads/Asprise-OCR-Java-MacOSX_Intel-4.0");
    //System.out.println(System.getProperty("java.librar y.path"));
    System.load("/Users/hussainalisyed/Downloads/Asprise-OCR-Java-MacOSX_Intel-4.0/libAspriseOCR.jnilib");
    BufferedImage image = ImageIO.read(new File("/Users/hussainalisyed/Downloads/Asprise-OCR-Java-MacOSX_Intel-4.0/sample-images/ocr.gif"));
    String s = new OCR().recognizeEverything(image);
    System.out.println("\n---- RESULTS: ------- \n" + s);
    }
    }

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

    Default

    Your second error suggests that Demo class itself was not found at all.
    Add it's path to the classpath.
    It is also a good idea to package your classes.

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

    Default

    thaks for reply
    I ve set classpath for Demo
    after that it gives an error like that
    Demo.java:6: package com.asprise.util.ocr does not exist
    import com.asprise.util.ocr.OCR;
    ^
    Demo.java:15: cannot find symbol
    symbol : class OCR
    location: class Demo
    String s = new OCR().recognizeEverything(image);
    ^
    Demo.java:17: cannot find symbol
    symbol : class OCR
    location: class Demo
    OCR ocr=new OCR();
    ^
    Demo.java:17: cannot find symbol
    symbol : class OCR
    location: class Demo
    OCR ocr=new OCR();
    ^
    4 errors
    siyas-mac-mini:src hussainalisyed$
    plz tell how can i fix that

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

    Default

    You need to have both Demo and the asprise.jar on the classpath.

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

    Default

    thanks for reply

    but this it gives an error like that
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/libAspriseOCR.jnilib: no suitable image found. Did find: /Library/Java/Extensions/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 :1771)
    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 Demo.main(Demo.java:18)

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

    Default

    You need to contact the people who provide asprise.jar to find out what causes that. Perhaps you are not using the recommended OS, OS version e.t.c

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

    Default

    okay thanks for help
    can u give one more favor plz
    do you know how to create vCard file in java
    as well as i want to store records well

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

Similar Threads

  1. Replies: 3
    Last Post: 02-22-2010, 07:08 PM
  2. Replies: 1
    Last Post: 11-20-2009, 07:58 PM
  3. Replies: 6
    Last Post: 07-16-2009, 03:30 PM
  4. Replies: 1
    Last Post: 08-07-2007, 07:10 AM
  5. Replies: 1
    Last Post: 07-25-2007, 10:55 PM

Posting Permissions

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