java.lang.UnsatisfiedLinkError: no xuggle-xuggler in java.library.path - java

I'm using Ubuntu 11.04 and Eclipse. I installed Xuggler succesfully, I've checked the environment variables and everything related with linux in their FAQ: http://wiki.xuggle.comFrequently_Asked_Questions#What.27s_up_with_java.lang.UnsatisfiedLinkError.3F
I also set up Eclipse according to their tutorial:
http://xuggle.wordpress.com/2009/01/23/how-to-write-your-first-xuggler-application-in-eclipse/
Whenever I try running any code which uses Xuggler I get the following error:
2011-09-14 14:17:30,093 [main] ERROR com.xuggle.ferry.JNILibraryLoader - Could not load library: xuggle-xuggler; version: 3; Visit http://www.xuggle.com/xuggler/faq/ to find common solutions to this problem
Exception in thread "main" java.lang.UnsatisfiedLinkError: no xuggle-xuggler 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.xuggle.ferry.JNILibraryLoader.loadLibrary0(JNILibraryLoader.java:265)
at com.xuggle.ferry.JNILibraryLoader.loadLibrary(JNILibraryLoader.java:168)
at com.xuggle.xuggler.XugglerJNI.<clinit>(XugglerJNI.java:19)
at com.xuggle.xuggler.IContainer.<clinit>(IContainer.java:1457)
at com.xuggle.mediatool.MediaReader.<init>(MediaReader.java:137)
at com.xuggle.mediatool.ToolFactory.makeReader(ToolFactory.java:77)
at recode.main(recode.java:16)
So, how to solve this?

I got the answer/solution from the xuggler-users google group, credits to Navin Bhutada:
solve it by including the Xuggle variables before runing the netbeans like this:
export XUGGLE_HOME=/home/xyzuser/xuggler
export PATH=$XUGGLE_HOME/lib:$XUGGLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$XUGGLE_HOME/lib:$LD_LIBRARY_PATH
/usr/share/netbeans/6.9/bin/./netbeans"
I use eclipse, so I just changed that last line, running eclipse from its folder through the command line and everything worked just fine.
Note: If I export the variables and try opening eclipse from a shortcut on my desktop it doesn't work. The shortcut point to the same file I ran from the command line
TLDR:
export variables you got after installing
run Eclipse from the terminal.

You just download correct Xuggle from this page based on ur os:
http://xuggle.googlecode.com/svn/trunk/repo/share/java/xuggle/xuggle-xuggler/5.2/
And then extract the lib files to project home folder.

I've found that even though I may have my environment variables set correctly, explicitly including the Xuggler install dir in the java.library.path when executing saves me from that problem.
i.e. java -Djava.library.path="$XUGGLE_HOME" myExecutable

Cause Could be un-availability of dependency jars or version conflicts.
Adding the following jars in the classpath worked fine for me:
xuggle-xuggler-5.4.jar
slf4j-api-1.6.4.jar
logback-core-1.0.0.jar
logback-classic-1.0.0.jar
Note: Add them in the library folder using "Add jar/Folder" Option in netbeans.

Related

Is it possible to get my SWT application to run anywhere just by adding the SWT binaries to the Java Build Path in Eclipse?

I made an SWT application using WindowBuilder in Eclipse. I exported the project as a runnable Jar File on Windows 10, then transferred the file to my Macosx machine, and I received this error,
$ java -jar Downloads/SWTApplication.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-win32-4926r21 in java.library.path
no swt-win32 in java.library.path
Can't load library: /Users/myhomefolder/.swt/lib/macosx/x86_64/libswt-win32-4926r21.jnilib
Can't load library: /Users/myhomefolder/.swt/lib/macosx/x86_64/libswt-win32.jnilib
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:344)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:256)
at org.eclipse.swt.internal.C.<clinit>(C.java:19)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:143)
at MainWindow.open(MainWindow.java:58)
at MainWindow.main(MainWindow.java:47)
I tried adding both the windows and mac versions of swt.jar file to the Java Build Path in Eclipse, and it did not work. Is there a way to get it to work just by adding the SWTs to the Java Build Path? Tell me if there are more steps to this process if there is.
I expected the program to run on my Mac machine, just like when I double click the Jar File on my Windows Machine, but it returned the error above.
Please bear with me since I'm relatively new to Java and SWT.

Encountered error setting up plugins for Minecraft Nukkitx server on Raspberry Pi

RPI 2B, running Debian/Jessie, with java version 1.8.0_65.
Downloaded latest nukkitx from https://nukkitx.com.
Followed installation instructions at https://github.com/IntellectualCrafters/PlotSquared/wiki/Installation.
Plugins I have installed:
Plot Squared 18.07.21-aaa7088-2022
FastAsyncWorldEdit 18.07.21-a00345f-1159-20.4.0
DbLib 0.2.3
Error I am encountering:
java.lang.UnsatisfiedLinkError: org.sqlite.core.NativeDB._open(Ljava/lang/String;I)V
Stack trace: https://pastebin.com/C3DrUm0Q.
Full server log: https://pastebin.com/2iuvQmbC.
As you can see, it says that PlotSquared has been loaded, but none of the plot commands are available. It just says unknown command when I type it. I have tried several different versions of all of the plugins, and a couple previous versions of nukkitx, all have the same problem. I'm thinking its something about my device, but I'm still pretty new to Linux and am not sure what to try next. Any suggestions would be amazing!
EDIT: I download the driver from https://github.com/xerial/sqlite-jdbc, and added it to the class path when calling the nukkitx jar to start the server. This didn't fix the problem. Here is the .sh file to start the nukkit jar:
#!/bin/sh
echo $USER
java -Xms1G -Xmx1G -cp ".;sqlite-jdbc-3.23.1.jar" -jar nukkit-1.0-SNAPSHOT.jar
I figured it out! For whatever reason, the JbLib sqlite driver apparently wasn't working. The solution was to remove JbLib (jar and folder) from the plugins folder, change the start.sh file (which I created according to the installation instructions) to use a classpath command instead of a jar command, add the xerial sqlite driver to the class path, and specify the Main Nukkit class to execute, like so:
java -classpath nukkit-1.0-SNAPSHOT.jar:sqlite-jdbc-3.23.1.jar cn.nukkit.Nukkit

Installing Chronix

I'm trying to install Chronix on my hadoop cluster(Raspbian) (http://chronix.io/) so i followed the tutorial (in Quickstart) but when i have to $ java -jar chronix-timeseries-exploration-0.2.jar
I got `ERROR:
Could not find or load main Class de.qaware.chronix.examples.exploration.ui.MainRunner`
So I've read lots of things about this, how to change classpath , ... but the thing is that opposite to all of the people who were asking questions, I don't know where the file is if not in the folder : /home/hduser/chronixShowcase so I don't know where to set the PATH I tried with path at:
/home,
/home/user
/home/user/chronixShowcase
/chronixShowcase/chronix-solr-6.0.1/
/chronixShowcase/chronix-solr-6.0.1/bin
with CLASSPATH=path export CLASSPATH
It may have to be downloaded but this file is not on Github (only this kind: chronix-importer/release/data/qaware-jenkins/20160226/jenkins_jenkins-jolokia_jenkins-jmx_qaware-jenkins_2016.02.27_00.00.00.csv.gz)
Do you have any suggestion to find the main class or export the right PATH or if it comes from elsewhere? I would be really happy if you could help me!
According to the quickstart it looks like you download it from GitHub
wget https://github.com/ChronixDB/chronix.examples/releases/download/0.2/chronix-timeseries-exploration-0.2.jar
From: https://github.com/ChronixDB/chronix.examples/blob/master/chronix-timeseries-exploration/README.md
JavaFX is not included in OpenJDK on Linux. As a result the following error occurs when starting the application with OpenJDK.
Solution
Use Oracle JDK that includes JavaFX
Install the missing JavaFX package for OpenJDK, e.g for Ubuntu:
Try:
sudo apt-get install openjfx

Cannot run OpenCV with JAVA in Eclipe, NetBeans or Intellij IDEA - java.library.path error

I am running Mint 17.1 (Rebecca) KDE (64-bit).
I installed opencv 2.4.8, from the repository, with the python bindings (and I am currently working with opencv-python).
I cannot run a simple example OpenCV program in Java, using an IDE. I tried Eclipse, NetBeans and Intellij IDEA.
I add the following library to the project:
/usr/share/OpenCV/java/opencv-248.jar
When I try to run a simple example source code, I got the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java248 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at Hello.main(Hello.java:7)
From the error, there is some problem with the java.library.path. Actually, I saw in some posts (all for windows users) where they do something like (step 5 - source):
Change VM options to add native library "-Djava.library.path="C:\opencv\build\java\x86""
But I am not sure how to implement this step in my system. For example, in Eclipse I added the following path: /usr/lib/x86_64-linux-gnu/
The reason for the above path was that I found that some of the libraries of opencv are there:
$locate opencv_core
/usr/lib/x86_64-linux-gnu/libopencv_core.a
/usr/lib/x86_64-linux-gnu/libopencv_core.so
...
Thank you.
solition :
==>Right click on the Project
==>Properties
==>Click on RUN
==>VM Options : -Djava.library.path="C:\Your Directory where Dll is present"
==>Ok

JNI UnsatisfiedLinkError .jnilib not fond

I am having some problems with linking a jnilib in java. I receive
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ***.jnlib in java.library.path.
Through my research I found that this could be caused by java not knowing were the file was. So, I told it that it was in the Mac folder. I also added the file to every other folder in the project. None of this helped at all. The project is cross platform so I tried it on windows the dll's loaded just fine when I told java to look in the windows folder. I do not understand why this would work in windows and not on a Mac. Any thoughts or ideas will be welcome.
The exception output is:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no libhidapi-jni-64.jnilib in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at webstart.OmronIO.<init>(OmronIO.java:30)
at webstart.Omron.main(Omron.java:13)
The java.library.path is: /Volumes/UNTITLED/javahidapi/mac.
The path to the jinlib is : /Volumes/UNTITLED/javahidapi/mac.
On OSX, the environment variable DYLD_LIBRARY_PATH is used to find shared libraries (including .jnilib). That variable is what is used to initialize java.library.path.
If you output the value of java.library.path at the point where you attempt System.loadLibrary(), you will see the list of directories searched for the library you are attempting to load.
EDIT
See also http://create-lab-commons.googlecode.com/svn-history/r222/trunk/java/lib/HIDAPI/README.txt, which appears to apply to the specific library you're attempting to load (hidapi), and the way you're attempting to load it (webstart).
I faced the same issue. It was not loading library file in any path, even after using - Djava.library.path in application argument. I am using System.loadLibrary("test"). The library name was libtest.jnilib
The prefix and suffix will be added while executing.
I am using Mac M1 Pro. Unfortunately, it is not supported in ARM based JDKs. Switching to non-ARM JDK solved the issue.

Categories