Library Error in Processing.org SimpleARToolKit & Java on Mac OSX - java

I am attempting to get SimpleARToolKit in the Processing.org IDE on my Mac. I have downloaded the SimpleARToolKit and JMyron files. I was getting some JMyron errors, but I moved the Library files and now those errors have gone away. The problem I am having now is when I try to run demo01.pde from the SimpleARToolKit, I get an error that says:
UnsatisfiedLinkError: no JARToolKit in java.library.path Exception in
thread "Animation Thread" java.lang.UnsatisfiedLinkError: no
JARToolKit in java.library.path at
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1754) at
java.lang.Runtime.loadLibrary0(Runtime.java:823) at
java.lang.System.loadLibrary(System.java:1045) at
net.sourceforge.jartoolkit.core.JARToolKit.(JARToolKit.java:40)
at pARToolKit.SimpleARToolKit.(SimpleARToolKit.java:36) at
demo01.setup(demo01.java:44) at
processing.core.PApplet.handleDraw(PApplet.java:1608) at
processing.core.PApplet.run(PApplet.java:1530) at
java.lang.Thread.run(Thread.java:680)
The demo is crashing on this line:
ar = new SimpleARToolKit(this, capWidth, capHeight);
I have found a few other websites that seem to be asking the same question, but none of them are in English and through using Google Translate, none of them seem to resolve the issue.
Update:
This is not yet resolved but I have an update:
I found jARToolKit on SourceForge.net
Inside the jARToolKit.zip folder I found jARToolKit.jar file and copied it to my Mac/Library/Java/Extensions/ folder
Now when I run the code, the error says "no jartoolkit in java.library.path" (note the lowercase "jartoolkit") - as opposed to the original "no JARToolKit in java.library.path". If I remove the .jar file from the Extensions folder, the original error appears again, so this makes me think that I am on the right track, but still missing something.

Related

Java Exception has occurred when opening .JAR file

I am trying to run a jar file that came with a program designed by BOSCH called EsiTronic. I receive the following error message "A java exception has occurred" I made some research and looked in the other threds of this forum but it did not help me. My gues is that the version I am using is not supporting the version the program was compiled on. I tried running it from CMD to see the detailed error message. If someone can tell me more from this message I will apreciate. I want to point out I am not a programer so my knoledge is limited here.
Thanks!
Exception in thread "main" java.lang.ClassFormatError: Truncated class file
Exception in thread "main" java.lang.ClassFormatError: Truncated class file
Theres nothing much that you can do here except re-download the jar file. The jar file probably got curropted during download or even at the time of packaging from the source

JVST UnsatisfiedLinkError

I am trying to run an example from the JVST library, and I get:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no
jvst-0.0.1 in java.library.path or on the classpath
I made sure that jvst-0.0.1.dll is in the same directory as the class that loads the file (compiled class, not source code), and in fact I tried even copying it in any directory of the project, but still it won't find it. Anybody has an idea why?
Thanks, Simone
EDIT: Solved, it turns out that JVST loads a 32 bits dll, and that won't work if your jdk is 64 bits. The tricky part was that the error message was changed, and it appeared as if the dll was not found.

java.lang.UnsatisfiedLinkError: no so in java.library.path

When i'm trying to load the .so file from the Java, i'm getting error like this.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no yeslib.so in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1047)
at com.rct.micros.util.GetCustClass.getScratchCode(GetCustClass.java:76)
at com.rct.micros.util.GetCustClass.main(GetCustClass.java:39)
I have tried System.load(absoulte path) and System.loadLibrary(sofilename). Both are giving the same error. When i copy this so file into usr/lib/jvm package, it is working..
can anyone help how to get this solved using Java. i'm running on linux box.
It's possible that the library is on your path, but it can't be loaded for some other reason.
A trick I've used to debug problems like this is to run java -Xrunsofilename
-Xrun is the JVM option to load JVMPI libraries (the old profiling interface). If it succeeds, it will load the library and complain that it's not an agent library. But if it fails (hopefully!) it will print an error message. This is usually a more descriptive error message than what you get from the UnsatisfiedLinkError.

no usbJava in java.library.path

I got a .jar file from a code that works on Windows, and I'm trying to run it on Linux, but I keep getting this message, and don't know what to do.
Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: no usbJava in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1856)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at ch.ntb.usb.LibusbJava.<clinit>(LibusbJava.java:366)
at ch.ntb.usb.USB.init(USB.java:315)
at ch.ntb.usb.USB.getBus(USB.java:296)
at ch.ntb.usb.Device.initDevice(Device.java:102)
at ch.ntb.usb.Device.open(Device.java:222)
at TransmitterModuleHIDInterface.run(TransmitterModuleHIDInterface.java:28)
at java.lang.Thread.run(Thread.java:722)
I'm using the Java wrapper for the libusb-0.1 (I followed the installation instructions here).
Any help would be really appreciated!
You need to create a link to the shared library, as per the Linux installation instructions:
http://libusbjava.sourceforge.net/wp/?page_id=8
If you're having trouble building the shared library this might be of some help:
http://me.opengroove.org/2010/01/libusbjavaso.html
The sources for the library itself is under /libusbjava/trunk/LibusbJava/ in the SVN source tree.

LoadLibrary can't find .dll in NetBeans

I trying to load SFmpq.dll via this code
static {
Native.setProtected(true);
System.setProperty("jna.library.path",
new File("lib").getAbsolutePath());
System.out.println(System.getProperty("jna.library.path"));
INSTANCE = (SFmpq) Native.loadLibrary("SFmpq", SFmpq.class);
}
It gets executed, Folder and File exist but I still get this error:
C:\Users\Frotty\Documents\NetBeansProjects\Optimizer\lib Exception in
thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Unable to
load library 'SFmpq': The specified module could not be found.
I gave the code and .dll a friend of mine who imported it into Eclipse and there it worked perfectly fine.
Can anyone spot my mistake or how do I import .dlls correctly?
You can get this error if you try to load a 32 bit library on a 64 bit system.
I've had success with using System.load(...) and System.loadLibrary(..) to load dlls

Categories