JVST UnsatisfiedLinkError - java

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.

Related

maven pass arguments to pom java.library.path cplex

I am trying to resolve this error that I keep getting:
java.lang.UnsatisfiedLinkError: no cplex1262 in java.library.path
java.library.path must point to the directory containing the CPLEX shared library
try invoking java with java -Djava.library.path=...
Exception in thread "main" java.lang.UnsatisfiedLinkError: ilog.cplex.Cplex.CPXopenCPLEX([I)J
at ilog.cplex.Cplex.CPXopenCPLEX(Native Method)
at ilog.cplex.CplexI.init(CplexI.java:5722)
at ilog.cplex.CplexI.(CplexI.java:611)
at ilog.cplex.IloCplex.(IloCplex.java:10384)
I am using maven with java and I am trying to call cplex library. I think something needs to change in the pom file but i dont know what. Please help. Thanks.
One possible cause for could be your dll being in 32 or 64 bits and your java being in the opposite architecture.
Try verifying that your java and cplex.dll match. I got this information from the below post UnsatisfiedLinkError, despite setting Djava.library.path variable

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.

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

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.

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

UnsatisfiedLinkError - What can this error mean? Every hint is useful!

In Eclipse I get this eror:
Exception in thread "main"
java.lang.UnsatisfiedLinkError:
com.nokia.mid.impl.isa.util.SharedObjects.nativeSetTable(Ljava/util/Hashtable;)Ljava/util/Hashtable;
I can see SharedObjects, but nativeSetTable doesn't seem to be a method. It might however be hidden -> I don't have access to the source code.
This was my code:
connection = (HttpConnection)Connector.open(this.url);
This is the trace:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
com.nokia.mid.impl.isa.util.SharedObjects.nativeSetTable(Ljava/util/Hashtable;)Ljava/util/Hashtable;
at
com.nokia.mid.impl.isa.util.SharedObjects.nativeSetTable(Native
Method) at
com.nokia.mid.impl.isa.util.SharedObjects.createTable(SharedObjects.java:465)
at
com.nokia.mid.impl.isa.util.SharedObjects.(SharedObjects.java:181)
at
com.nokia.mid.impl.isa.io.GeneralSharedIO.(GeneralSharedIO.java:67)
at
com.sun.midp.io.ConnectionBaseAdapter.checkForPermission(ConnectionBaseAdapter.java:236)
at
com.sun.midp.io.ConnectionBaseAdapter.openPrim(ConnectionBaseAdapter.java:205)
at
com.sun.midp.io.ConnectionBaseAdapter.openPrim(ConnectionBaseAdapter.java:178)
at
com.sun.midp.io.InternalConnector.openPrim(InternalConnector.java:254)
at
com.sun.midp.io.InternalConnector.open(InternalConnector.java:153)
at
javax.microedition.io.Connector.open(Connector.java:138)
at
javax.microedition.io.Connector.open(Connector.java:120)
at
javax.microedition.io.Connector.open(Connector.java:104)
I think that nativeSetTable() is protected or private, that's why you don't see it. And moreover nativeSetTable() is a native method, which means that it is based on native code (already compiled for a specific processor and available in a specific lib [ie. a DLL]).
UnsatisfiedLinkError means that this particular method couldn't be retrieved and executed properly.
Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native.
This means that your Java ME emulator must have missing librairies. You should try to reinstall it.
Resources :
Javadoc - UnsatisfiedLinkError
I guess you are coupling your source code with the wrong version of the nokia mid library.
It could be that your runtime classpath is using a different version of the jar where SharedObjects lives, when compared to your compile-time classpath in Eclipse. I would double-check your classpath settings.
Ok, I found one reason:
I created a test class in java to test my code, just a plain java file (with main method). And I ran it as a plain java application. Then, it doesn't work. But after I tried it in a Midlet, I didn't get the error!

Categories