No LeapJava in java.library.path - java

I'm encountering a problem with the build of my JavaFX project with the Leap Motion.
When I run the file.jar, the application's window is opening, but when I call the leap motion, it's not working any more.
I have the following error :
Native code library failed to load.
java.lang.UnsatisfiedLinkError: no LeapJava in java.library.path
Yet, I have configured the buildpath. I have added the leapJava.jar, with the native library x64.
I don't understand why it doesn't work ?
Anyone with an idea ?
Thanks

The LeapJava.dll is missing or the Java library path is not set up correctly. Please have a look at the docs - setting up a project:
https://developer.leapmotion.com/documentation/java/devguide/Project_Setup.html

I have followed each step in the Eclipse section. :/

Firstly, since you haven't mentioned any specification about your system, I am answering this in context with a 64 bit Ubuntu machine.
You will posses a libLeap.so and a libLeapJava.so in 'YourDeveloperKitDirectory'/LeapSDK/lib/x64/ . These files should be copied to your /usr/lib and the configuration/bulid path (if using IntelliJ IDE -> 'Edit Configurations'->'Application'->'configuration'->'VM options'->"-Djava.library.path=/usr/lib") should be appropriately stated.
Save and run your application.

I had this problem, what solved it was adding -Djava.library.path=/Path/to/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib to the command line call for the .jar file. (make sure your developer kit is the right version)
So rather than:
java -jar leapMotionProgram.jar
It had to be:
java -jar -Djava.library.path=/Path/to/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib leapMotionProgram.jar

Related

Java version determination error

I just install Android Studio 1.5 on Ubuntu 14.04. I created a new project and I get the following error:
Error:Could not determine Java version using executable /usr/lib/jvm/java-1.5.0-gcj/bin/java.
My /usr/lib/jvm/ contain:
java-1.5.0-gcj java-7-oracle java-gcj
java-1.5.0-gcj-4.8-amd64 java-8-oracle java-gcj-4.8
The Project Structure has the JDK location set up to /usr/lib/jvm/java-1.5.0-gcj. Should it me something else ? How can I know ?
Many thanks for you help !
I solved my problem by simply changing the JDK to /usr/lib/jvm/java-8-oracle. I still don't know why it works, or why it should have been like this at the first place.
Sorry for the question.
The problem occurred because location of the JDK directory was not defined correctly.
In Android studio File ->Project structure ->in left side tabs click on SDK location->define the directory where JDK is located .
For example:/usr/lib/jvm/java-8-oracle/jdk1.8.0_77 is my directory of JDK.The location can be different.
Another variant:
Replace homePath value in ~/.AndroidStudio1.5/config/options/jdk.table.xml on /usr/lib/jvm/java-8-oracle/bin/java

Can't load Java Library

I am very new to Java and I am trying to run a program I got from a friend. I keep getting this error and I'm unsure how to solve the problem.
Application is starting. Fetching data. Please wait... (approx. 10s)
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-cocoa-4236 in java.library.path
no swt-cocoa in java.library.path
Can't load library: C:\Users\Andrew.swt\lib\win32\x86_64\swt-cocoa-4236.dll
Can't load library: C:\Users\Andrew.swt\lib\win32\x86_64\swt-cocoa.dll
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:331)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:240)
at org.eclipse.swt.interal.C.<clinit>(C.java:21)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:101)
at view.MainWindow.open(MainWindow.java:77)
at view.MainWindow.main(MainWindow.java:65)
Apparently I'm missing the SWT library (swt-cocoa-4236 and/or swt-cocoa?), but I have no idea where to get it. That statement probably reveals my ignorance. If anyone could even point me in the right direction to where I might be able to solve the problem I'd be very grateful. Thanks!
Seems like the program that you are running is not built for your OS. SWT is OS dependant and JVM depedant. All SWT programs will use swt.jar which will be different based on the underlying OS. The one the program is using is built for Mac OS and seems like you are running that on a non-Mac system.
Regarding 'How to solve it', it depends on how the program that you are running is packaged.
Check the java version you are using and download appropriate SWT jar file.
I think Mubin (i.e. the above answer) is correct. here is where you can download the specific version of SWT.jar for your environment http://www.eclipse.org/swt/.
(I am answering your question for "I have no idea where to get it.")
little late to the game, but i just had the same problem and found this solution:
Here's what worked for me:
Right Click on your Project Folder of your HelloWorldSWT Project-> Properties -> Java Build Path -> Tab 'Projects'
Expand the 'org.eclipse.swt.cocoa.macosx.x86_64' folder by clicking on the arrow left to it
Select 'Native library location' and click Edit
Click the Workspace Button and select 'org.eclipse.swt.cocoa.macosx.x86_64', then click ok (serveral times).
That did the trick ... Ma-an

adding openCV to java buildpath in eclipse

I have problems adding openCV to the buildpath of my eclipse-project. I have followed the instructions in the tutorial on this site: http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html#create-a-simple-java-project-in-eclipse
But executing the code fragment gives this console output:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv-java2.4.4 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at camStatisticsTests.RawTests.main(RawTests.java:20)
What do I have to do in order to get openCV working with java and eclipse. i want to use it as a normal java library.
I had the same problem.
It happened because I had a mistake with the 'Native library location' configuration:
Goto Eclipse -> Window -> Preferences:
Goto User Libraries:
Make sure that your native library location path is (change c:/opencv-2.4.9 to your own opencv folder):
C:/opencv-2.4.9/build/java/x64
and not:
C:/opencv-2.4.9/build/x64
(I missed the /java folder...)
The OpenCV java library is correctly linked to your Eclipse project.
The problem is the OpenCV native library which is not in the java.library.path. The exception is thrown by the line
static{ System.loadLibrary("opencv_java244"); }
which link the java library to the native one.
When you install OpenCV on your computer, it will also install a native dll library somewhere on your system, and when you call the System.loadLibrary, you tell java to search and load this library.
Your current problem is Java can not find this library in your System, either because the library is not in one of the java.library.path folders, or because you have not OpenCV installed (also take a look at the version, maybe you have not the 2.4.4 because the last is 2.4.5, in which case you will have to adapt the String).
I just noticed that your exception is about "opencv-java2.4.4". Be sure to have the right spelling of the form "opencv_java244", in your System.loadLibrary call.
I also redirect you to one of my answer, which is related to JavaCV, but that explain in more details what is going under.
I found a solution. The actual dll is located in the openCV\opencv\build\java\x64\ folder. In my case, its name is opencv_java247.dll, so I have changed System.loadLibrary("opencv_java244") to System.loadLibrary("opencv_java247") in my java code. I also put the native library location as E:/Sagar_tools/tools/openCV/opencv/build/java/x64 (which is my full path to the dll).
For me, Eclipse > external jar > native library config = opencv/build/lib
worked
I have found the solution. The tutorial skips the step, where one has to add a dll to the "native build path". The dll is located in "opencv/build/java/x86" for 32-bit java i guess. although i dont know why this is the case. Would be nice, if someone could explain that.
Change the code to System.loadLibrary("opencv_java244")
hope you would set the native path to correct folder and opencv jar has set in build path

RCP's exec launcher can't find companion shared library on launch, but starts with click on org.eclipse.equinox.launcher_1.2.0.v20110502.jar

I'm building an Eclipse RCP application against Eclipse 3.7.1 and Java 1.6.
I'm also using Tycho to build, and have set up my RCP according to the Tycho tutorial from the EclipseCon 2011, to which I've stuck slavishly, apart from project names.
The application builds fine up until I get to Step 5 (adding a p2 repo, then adding a .product file. Well, it still builds fine, and everything is where it should be, but I cannot start the RCP by clicking on the .exe file from the repository in the workspace.
All I get is the old dreaded "The [RCP] executable launcher was unable to locate its companion shared library" error popup.
First of all I thought I might have set up the CLASS PATH incorrectly, but when I open a console and type javaw or java -version anywhere, it all works.
Also, when I go to the pluginsfolder in the p2 repository for the RCP in the workspace, and double-click on org.eclipse.equinox.launcher_1.2.0.v20110502.jar, the RCP starts, albeit without the splash screen.
This must surely mean my Java set up is correct, and it's not a class path problem?
I'm not sure where this problem might lie (I have a plugin, a feature, a product, a repository, and a parent package with the main pom), so if you let me know your suspicions where the error might come from, I'll be more than happy to post respective XML, build.properties, screenshots and what have you. Unless this is a common error with a common solution.
Many thanks in advance!
Oh yea: Windows 7 (64-bit), JDK and JRE both 64-bit as well, Eclipse EE 3.7.1 (I chose that because it contains the most plugins I'll need later by default).
UPDATE
I'm attaching my CLASS PATH Settings for reference.
User variables
CLASS PATH: C:\Program Files\Java\jdk1.6.0_30;.;
System variables
JAVA_HOME: C:\Program Files\Java\jdk1.6.0_30
Path: %JAVA_HOME%\bin;
UPDATE 2
When I let Tycho create a ZIP file in the p2 repository, and copy that from the repo to another location, unzip it and run the .exe, the application starts without problems. So I guess this query is partially solved, but I'd still be interested to hear why I wouldn't be able to start the application from the repository...
Today I came across the same issue. I guess you could find the solution here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=176084
In short, the problem in my case was, that the org.eclipse.equinox.launcher_1.2.0.v20110502.jar must be unpacked in the plugins folder under the folder name: org.eclipse.equinox.launcher_1.2.0.v20110502
... hope that helps!
In my case the error The [RCP] executable launcher was unable to locate its companion shared library was because my path was too long.
Same issue I was facing from yesterday. Today, I have changed path of project(git clone) and build it and able to run RCP executable.
I think this issue was because of path too long.

no ocijdbc10 in java.library.path

So I've been plagued by this issue, whenever I try to run my app in eclipse, I get this error.
2011-02-23 09:55:08,388 ERROR (com.xxxxx.services.factory.ServiceInvokerLocal:21) -
java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path
I've tried following the steps I found here with no luck. I've tried this on a XP VM as well as windows 7 (although in win 7 I get a different error, below)
java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
I've made sure my oracle client was ok (by running TOAD) and I also re-added the classes12.jar / ojdbc14.jars to my WEB-INF/lib folder taken directly from my %ORACLE_HOME% folder (also re-added them to the lib path). I've also tried just adding the ojdbc14.jar without the classes12.jar. Any suggestions appreciated.
In the XP VM I have my PATH variable set to C:\Program Files\Java\jdk1.6.0_24\bin;C:\ORACLE\product\10.2.0.1\BIN. I'm using Tomcat server 5.0
I agree with the advice you've gotten in the comments to use the thin driver instead of the OCI driver if you can. It is simpler and it should bypass the problem you're having.
If you do need the OCI driver for some reason, your problem is that the DLLs are not on your Java library path. This is separate from the classpath that is used to locate class definitions. The clues here are (a) the fact that the error references java.library.path, and (b) the fact that you are getting an UnsatisfiedLinkError rather than a ClassNotFoundException.
You would need to set your java.library.path property to include the location of the DLLs, or add the location of the DLLs to the Windows PATH, in order for Java to locate them.
More information here: http://forums.oracle.com/forums/thread.jspa?threadID=615281
I have encountered this same error twice recently. The first time I managed to resolve it without knowing exactly what I did. Don't you just hate that because when it shows up again what do you do? Well it did show up again when I had to create a new project in eclipse. This time I know what the problem was and it is a very simple thing to overlook and fix. The other posters have great information but it won't help you if you have the same root cause that I had and I believe that you do...
The issue was simple and it was this: I had two different ojdbcXX.jar files in my Java buildpath (within Eclipse). I had both ojdbc14.jar and ojdbc6.jar Apparently it was hitting ojdbc14.jar first and then throwing the error. Once I removed the unnecessary jar file then the error went away. Drove me crazy for an entire day before I realized what was wrong!
I hope this helps.
This error occurs when you have a wrong/older version of oci.dll. After setting the path and reverting to the correct oci.dll, the error went away.
I also meet this error when i use DBvisualize to connect Oracle database.
I think it is because you have not yet installed Oracle Client.
After installing it, maybe it is ok
I had the same problem while using MyEclipse. One needs to set the path to oracle clients lib and bin folder. Attaching image for reference. Hope it helps
enter image description here

Categories

Resources