I am trying to launch an application (not Eclipse) that was written in Java. When I do, I get an error that says "Failed to Load the JNI shared Library (JDK)" along with a path that points to the location of the file.
From searching Google and StackOverflow, all I can find are people saying that the Java version installed needs to match my machine. My machine is 64 bit and so is my java installation, so I don't think that is my issue.
I have also verified that C:\Program Files\Java\jre7\bin is in my path variable. Also, just for the record, I do not use Eclipse. I have also tried uninstalling and reinstalling Java an the application that was written in Java. Lastly, the file it is complaining about exists on the machine.
Does anyone know what else could be the cause of this problem?
Update:
Thanks for your responses. I got it resolved, but the resolution seems like more of a hack and goes against what I was reading earlier. I installed the 32 bit version of Java 7 along side of my 64 bit version of Java 7. I then added the path the 32 bit version to the system path variable.
After I did this, the application was able to launch. Is there an issue with having both 64 bit and 32 bit versions of Java 7 installed simultaneously?
This is an error from your application. The application uses JNI. It is complaining that it cannot load it. Why it says (JDK) only its author knows. You will have to ask the author.
There is no problem having both versions of Java installed. However, the application you were using probably shipped with a 32-bit version of the JNI library. So, it needed to be used with a 32-bit Java JRE.
Related
I tried to download Java on my laptop (which has windows 10) but i keep getting a 1603 error. My computer used to have windows 8.1 and it did not work back then either
I appreciate any advice to solve or work around this problem
I have had this problem. I was able to fix it thanks to a co-worker. The problem started happening after I installed HP Unified Functional Testing (UFT, aka QTP). Installing this product changes the Windows environment variables used by Java. He told me the following: "So change the names of JAVA_OPTIONS, IBM_JAVA_OPTIONS, JAVA_TOOL_OPTIONS to something else (both in system and user variables) and delete any Java folder(in Program Files (x86) or Program Files) which gets installed despite the error. Restart the system and then try installing Java."
Actually, all I did was rename the environment variables and run the installer. This worked.
My answer is not related to win 10, but might help someone who is having similar problem in windows 7 machine and not able to install jre 32 bit version.
the work around to this is once you downloaded the jre, copy the path "C:\Program Files (x86)\Java\jre1.8.0_121\bin\javaw.exe" and paste it under java runtime environment settings which is found -Java Control panel>java>view
I think you downloaded the wrong version. If your laptop support x64 bit software you should download Java 1.8 x64 version.
Here is the link.
https://www.java.com/en/download/manual.jsp
I had this problem for a month now. I tried everything on my windows 8, but I couldn't get the latest java on it. When I tried to install java on an empty computer, the 64 bit version did not go through (error 1603) and I realized the problem didn't come from an old java install and I install 32 bit. it worked on the new computer with windows 7 and on my computer running 8.1.
note: I had deleted all the java versions before going through with it.
To fix java 1603 error you have to follow few simple steps.
First of all remove all old java version.
Then remove some windows update file which might be reason of this
error. Like KB2918614 update.
After that download and Install latest version of java and activate
java in browser. Now everything will be fine you can test the java
version on java website...
For explained and easy solution to java 1603 error follow this link: http://protechguides.com/java-error-code-1603-solved/
I encountered this error on Windows 8.1 and when I checked with Oracle web site, they said that is is not yet resolved, and under investigation. They also showed a link for off-line installation as an alternative arrangement. However, upon investigation of my system, i found out that the available space in C drive was only about 20 MB or so. I cleared my system and provided enough space. When I tried with the extra space, I didn't encounter any error. May be, you could try with a better free space...
First you should close the browser because if any webpage will use Java, it will cause conflict. Then do custom installation, i.e. install in some other folder other than default folder and point environment variable to newly installed Java location. It will resolve your issue.
I downloaded bluecove-2.1.0.jar and added it as an external JAR on my Eclipse project. I am following this tutorial for using Bluetooth with Android: http://luugiathuy.com/2011/02/android-java-bluetooth/
When I run the program intended for my laptop to act as a server, I get an error stating 'Native library bluecove not available'. I made sure bluetooth was enabled by typing 'bluetooth' in Spotlight (which took me to Bluetooth File Exchange and allowed me to select a file to send).
I saw another Stackoverflow post stating that BlueCove requires 32-bit JVM to run so I added the -d32 argument under VM arguments in the run configuration. When I ran it, I got another error stating
"Error: This Java instance does not support a 32-bit JVM.
Please install the desired version."
Does anyone have any ideas on how to fix this?
Try using OpenJDK rather than the Oracle JDK. This supports the -d32 arguments so it ought to work for you.
OpenJDK may work as Mike suggested but its installation process was rather involved. I found a workaround by installing an earlier version of Eclipse that supported 32-bit OS X versions and setting -d32 in the VM arguments there worked without issues. Be sure to keep the earlier version of Eclipse in a separate folder so it doesn't overwrite your recent version.
I installed the 32-bit version of Eclipse Kepler from here: https://eclipse.org/downloads/packages/release/Kepler/SR2
Of course, Bluecove had some other issues with IOBluetooth device not found (since Apple removed that since OS X 10.8 I believe), for which you can check here for a possible solution.
Im running Java 1.8.0_065 (64 Bit) on Windows 10 (64 bit). I've downloaded the latest cmake version (3.4.0-rc2) for windows and the latest VTK sources (6.3.0). I generated a VS2015 solution via cmake and set up everything (seemingly!!) successfully using this tutorial:
https://www.particleincell.com/2011/vtk-java-visualization/
When I try to run the DemoJavaVTK.java which is provided by the tutorial I get linker errors in IntelliJ. (14.1.5) At apperently every VTK library that has to be loaded there is the same error:
java.lang.UnsatisfiedLinkError: C:\Program Files\VTK\bin\ANY_VTK_DLL.dll: Can't find dependent libraries at
java.lang.ClassLoader$NativeLibrary.load(Native Method) at
java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938) at
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854) at
java.lang.Runtime.loadLibrary0(Runtime.java:870) at
java.lang.System.loadLibrary(System.java:1122) at
vtk.vtkNativeLibrary.LoadLibrary(vtkNativeLibrary.java:223) at
vtk.vtkNativeLibrary.LoadAllNativeLibraries(vtkNativeLibrary.java:158)
at sample.DemoJavaVTK.(DemoJavaVTK.java:54) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:264) at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
Mind that ANY_VTK_DLL is just a placeholder. Concrete examples would be: vtkViewsContext2DJava.dll or vtkRenderingVolumeOpenGLJava.dll.
The path should be correct. All the "versions" are 64 bit. I compiled VTK for 64 Bit. I'm running a 64 bit OS with 64 bit java.
The wierdest thing is: Using eclipse everything works fine and I can run the VTK-demo without any problems. Also I'm using VTK for a course at my university, I'm working on my project with a colleague who has the same java and intellij version. He also used the same tutorial to set up VTK/Java. And the example also works in IntelliJ for him. The only difference I can tell between his and my system is, that he is using Windows 8.1 and I am using windows 10.
I really don't know where to continue from here. What is IntelliJs problem?
Got it fixed out of pure randomness by manually setting the JRE via the Run-configurations:
http://puu.sh/l3315/7c1d5e3393.png
Why does this work?
Update:
The UnsatisfiedLinkError denotes that the Java Virtual Machine (JVM) cannot find an appropriate native-language definition of a method declared as native. Specifically, in order to find the required native library, the JVM looks in both the PATH environment variable and the java.library.path system property. (Got from this article)
I used to have this kind of problems mostly because two causes:
The native librarie cannot be found (i.e don't exist)
The library being linked is not the same (Debug vs Release, 32 bit
vs 64 bit, VC10 vs VC9, etc.)
The library is already loaded by your application and the application tries to load it again
The native library is present either in the java.library.path or in the PATH environment library of your application
In order to be sure to whom library you are linking use Dependency Walker. Using this tool will make you understand what's wrong by telling you to which native libraries you are linking to.
Download the tool and then open C:\Program Files\VTK\bin\ANY_VTK_DLL.dll to see to which library it's linking to and where they are in your machine. Then make sure that IntelliJ can find these paths.
Here is a good tuto on how to use this tool: http://www-archive.mozilla.org/quality/help/dependency-walker.html
If they are the correct ones, verify the class path that IntelliJ Idea uses to launch your application to check that the native libraries are there.
I could run using,
System.setProperty("vtk.lib.dir", YourBuildVTKLibPath);
I am new using VTK, took me a while to fix this, I am using eclipse ,
I added to the PATH environment variable the dll folder and the lib folder
First off, I've been trying to launch Eclipse but I kept getting the below error
Failed to load JNI shared library "C:\Program Files (x86)\Java\jdk1.8.0_25\bin...\jre\bin\client\jvm.dll"
So I looked through this thread
Failed to load the JNI shared Library (JDK)
The sensing I got was that I might want to uninstall Java and make sure I have the right 64 bit version, since I already have a 64 bit Eclipse.
I went ahead and went to uninstall the Java Update files via the control panel, which went fine.
Then when I tried to delete the Java files in my Program Files (x86) folder, I can't do it as the "file is being used by another process"
Now I can't install a new version of Java as I get an error code 1603 owing to the incomplete Java files, and I still got my JNI shared library error to fix.
I'm really stuck now. What do I do?
If you use 64 bit eclipse, you need a 64 bit operating system and 64 bit JDK. Close your eclipse and JDK, remove X86 JDK and install 64bit JDK.
ctrl+shift+esc open task manager and end all processes that are opened by java. Sometimes when you run java and your applications don't close properly, java run-time environment is still running. So you have to force java out of that state. Next time, i'd just install the newer version of java right on top of the old one. Because the installation process removes the old version of java for you and replaces it with the newest one.
with jframes using the code
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
this is essential to your program so it closes completely.
I know JMF is pretty much dead and whatnot, but I do know that it can still be used.
I intend to use it for personal uses and don't expect that much from it.
I have managed to install the 32bit JMF and when I run JMStudio it somehow magically works even though all of my java jres and sdks are 64-bit.
I personally believe that this proves that it CAN work.
When creating a program importing the jmf.jar as a library, my code compiles perfectly.
Only at runtime do i get any form of error with the common:
Exception in thread "VFW Request Thread"
java.lang.UnsatisfiedLinkError: JMFSecurityManager:
java.lang.UnsatisfiedLinkError: C:\Program Files
(x86)\JMF2.1.1e\lib\jmvfw.dll: Can't load IA 32-bit .dll on a AMD
64-bit platform
Obviously there is a problem with using a 32bit dll on a 64bit system.
My question is if its not compatible:
how does JMStudio work perfectly fine (it definitely uses java)
how can I fix it so that my program can run without depending on this dll
or other workarounds
Thanks a ton to anyone who has ever tried this before.
Java is definitely lacking in native specific tools such as webcams.
I think the main issue is the 64bit Java JRE/JDK trying to use the 32bit JMF, and/or JMF having a problem with the path that Windows 7 chooses as a default to install it to.
I have had success following the instructions posted here:
Oracle Forums: Install JMF on Windows 7 64bit
It basically boils down to:
Install a 32bit JRE/JDK, and ensure that this is what your code uses.
Install JMF to simple directory in the root of C: (i.e. c:\JMF2.1.1e)
Good luck!
JMFStudio is 32 bit supporting software so we must install 32bit support JDK and also Eclipse then we not get any exceptions as you mentioned in above and errors.
For my case it works fine.
and also
Try to remove unused jdk path in environment variable, if duplicate path present then also it not works fine
other wise you should re-install OS.