Results 1 to 9 of 9
- 02-23-2010, 05:49 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 37
- Rep Power
- 0
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
- 02-23-2010, 05:50 AM #2
Member
- Join Date
- Feb 2010
- Posts
- 37
- Rep Power
- 0
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);
}
}
- 02-23-2010, 06:49 AM #3
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
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.
- 02-23-2010, 07:02 AM #4
Member
- Join Date
- Feb 2010
- Posts
- 37
- Rep Power
- 0
thaks for reply
I ve set classpath for Demo
after that it gives an error like thatplz tell how can i fix thatDemo.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$
- 02-23-2010, 09:59 AM #5
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You need to have both Demo and the asprise.jar on the classpath.
- 02-23-2010, 10:22 AM #6
Member
- Join Date
- Feb 2010
- Posts
- 37
- Rep Power
- 0
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)
- 02-23-2010, 10:27 AM #7
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
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
- 02-23-2010, 10:54 AM #8
Member
- Join Date
- Feb 2010
- Posts
- 37
- Rep Power
- 0
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
- 02-23-2010, 12:22 PM #9
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Similar Threads
-
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\WINDOWS\system32\Aspris
By Hussain Ali in forum EclipseReplies: 3Last Post: 02-22-2010, 07:08 PM -
Runtime error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
By shantimudigonda in forum New To JavaReplies: 1Last Post: 11-20-2009, 07:58 PM -
Exception in thread "main" java.lang.NullPointerException at LinkedList.main(Link
By kavitha_0821 in forum New To JavaReplies: 6Last Post: 07-16-2009, 03:30 PM -
ERROR: Exception in thread "main" java.lang.NoSuchMethodError: main
By barney in forum New To JavaReplies: 1Last Post: 08-07-2007, 07:10 AM -
Error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
By romina in forum New To JavaReplies: 1Last Post: 07-25-2007, 10:55 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks