Java - java.lang.UnsatisfiedLinkError - java

I am facing an issue with my application.
I created a java application. And it is working without problems, but I wanna obfuscate it. For renaming classes I am using ProGuard, so, i obfuscate it.
And getting the below error:
> Exception in thread "main" java.lang.UnsatisfiedLinkError:
Native library <org/apache/culler/win32-x86-x64/jnidispatch.dll> not found in resource path
<file:C:/Users/MyCoolUsername/Desktop/awesomeapp.jar]>
But, without obfuscation it working without any problem. Also it happened if I use JName, and other obfuscators.
How to fix it?

Related

Exception in thread "main" Syntax error: This module cannot be found. Java Alloy program not compiling

I have written a Java program that will execute an Alloy (.als) file. When I am using the commandline the program works perfectly but when I try to run it using NetBeans, this error is shown:
Exception in thread "main" Syntax error:
This module cannot be found.
It is not a built-in library module, and it cannot be found at "C:\Users\brinto dibyendu\Documents\NetBeansProjects\Alloy\util\integer.als".
What can I do?
Alloy is built & developed with Bndtools running in Eclipse. Trying to run it in Netbeans is just creating a huge amount of problems that you can avoid by taking the default route.
In Eclipse, all set up to immediately debug the main application is already done. It actually ensures resolves are handled inline instead of in another process so they are easier to debug. Then just debug it. Search for "built-in library module," and see what's happening there.
Even better, in Eclipse even the tiniest change you make to Java source code is immediately reflected in the runtime.
The quickest way I've found to fix this is to duplicate the .als files for the utilities in your file system.
Assuming your model (.als) file is in folder C:\Users\brinto dibyendu\Documents\NetBeansProjects\Alloy\, you'll need to create a util\ subdirectory in that folder and copy the source of the integer utility model (integer.als) into that subdirectory.
You can get the utility model files here.

Using the Matlab-Java-API gives "no nativemvm in java.library.path"

I am trying to run a Matlab function (Matlab 2017a) from Java (as shown here) and want to use the Java Matlab engine API for this purpose. I started adding the engine.jar file to the external libraries (I'm using the IntelliJ IDE). However, this gives the following error: "Exception in thread "main" java.lang.UnsatisfiedLinkError: no nativemvm in java.library.path"
A first search got me here where it says that the matlabroot should be added to the PATH permanently. So I checked my PATH using the Windows UI to find that matlabroot\R2017a\bin is already included. However, in my case I still get the error and have no idea what to do now. Any help is highly appreciated.
Answering my own question: Adding \R2017a\bin\ to the PATH is not sufficient. It has to be \R2017a\bin\win64 and then it works.

AWS Java SDK Error - java.lang.NoSuchMethodError

I've seen this type of error over here for exceptions that are thrown by various classes, though I haven't found the right solution for mine just yet.
I'm trying to get AWS Java SDK work locally so I can write a test application that reads data from a Kinesis stream.
Problem is, when I run the init() static method I encounter the following error:
Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.http.impl.conn.DefaultClientConnectionOperator.<init>
(Lorg/apache/http/conn/scheme/SchemeRegistry;Lorg/apache/http/conn/DnsResolver;)V
Now, this is not the first error I've been thrown. I've been thrown four or five exceptions prior to this one, and the solution to all of them was just importing some jar's into the project. e.g.:
apache-httpcomponents-httpclient.jar
com.fasterxml.jackson.databind.jar
commons-codec-1.9.jar / commons-codec-1.9-javadoc.jar / commons-codec-1.9-sources.jar
httpclient-4.2.jar
httpcore-4.0.1.jar
I've seen in other threads around here that it could be the version of the httpcore library, however I imported the latest one.
Any ideas how I can resolve this? I'm thinking about starting over, as my project seems to be a heap of imports I'm not sure I'll actually utilize. Furthermore, I can't debug the binary imports of the AWS SDK (or can't I?).
Cheers.
Problem solved, I gradually added the missing libraries to the project and when the apache httpclient jar should be version 4.0 or later, and without any previous version to contradict.
I imported httpclient-4.2.jar and it worked.
Other than that, I just solved the exception that followed by importing joda-time-2.4.jar and it's all up and running.

How to resolve Exception in thread "main" java.lang.UnsatisfiedLinkError: no jogl in java.library.path?

I am stuck one point.
I am getting this error from eclipse
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
I tried few links and tried to solve problem, but I am unable to do so.
I changed Jar file location, no output
I also tried to change eclipse.ini, but it also couldn't resolve it.
What should I do?
If any other information or image is required regarding issue, I will provide. ask me in comments.
Thanks
Duaan
In your run configuration in Eclipse, add
-Djava.library.path=<path to JOGL>
under Arguments -> VM Arguments.
When you run outside of Eclipse, you'll need to make sure the native libraries are accessible too. As Hot Licks mentioned, these are the native libraries (e.g. dll files in Windows), not just the Java class files that come with JOGL.

NO java.lang.NoClassDefFoundError error in Eclipse

I have a project in eclipse which was working fine untile a few minutes ago. I added a JDBC driver ad tried to run it, now even previous runnable file are giving me
Exception in thread "main" java.lang.NoClassDefFoundError: sample
Does anyone have any idea why it is happening does it have anything to do with the jar?
I have even removed the jar.
Try following, one by one
If you are using libraries, check whether everything is included to the project properly.
Rebuild the project
'worked few minutes ago' means it used to work. Did you add any new code? Then the error is there, check whether those codes call other classes, and whether they are available
Restart IDE
Once I used the following to solve the same issue
http://javarevisited.blogspot.com/2011/06/noclassdeffounderror-exception-in.html
If all above failed, that may be due to crash in JVM. I have experienced that as well.

Categories