I've created a Matlab's function that I want to call from a Java App. Since I don't have matlab installed in this machine I use Matlab Runtine (version 8.5, 32 bits).
When I execute the code, I get this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to find the required library mclmcrrt8_5.dll on java.library.path.
This library is typically installed along with MATLAB or the MCR. Its absence may indicate an issue with that installation or the current path configuration.
The MCR version that this component is trying to use is: 8.5.
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ProxyLibraryDir.get(MCRConfiguration.java:259)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ProxyLibraryDir.<clinit>(MCRConfiguration.java:265)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getProxyLibraryDir(MCRConfiguration.java:270)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$MCRRoot.get(MCRConfiguration.java:71)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$MCRRoot.<clinit>(MCRConfiguration.java:81)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getMCRRoot(MCRConfiguration.java:86)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ModuleDir.<clinit>(MCRConfiguration.java:60)
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getModuleDir(MCRConfiguration.java:65)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.<clinit>(MWMCR.java:1503)
at BCI.BCIMCRFactory.newInstance(BCIMCRFactory.java:60)
at BCI.BCIMCRFactory.newInstance(BCIMCRFactory.java:71)
at BCI.Class1.<init>(Class1.java:104)
at bci.pruebaEEG.main(pruebaEEG.java:24)
I've included to my PATH environment's variable the dll's path:
C:\Program Files (x86)\Matlab\Matklab Runtime\v85\runtime\win32
Matlab's version used to create the previous function was R2015a (32bits) and to compile the Java Package, jdk 1.7 (they're supposed to be compatible).
Can anyone help me??
Thanks in advance!
Okay, I was able to find the solution to my dll's problem. So, if someone else is also getting continuously this "Failed to find the required library mclmcrrt8_5.dll on java.library.path." error and has already followed this steps, please check if your jre version matches with the 32/64 bits version of the matlab compiler (MCR)
I was running my Java application from Eclipse and fool of me I didn't realize I was using (x64) jre7 instead of (x86). I just had to download the correct one and add it to the JRE System library. Now everything runs perfectly.
I am trying to use the 64 bit rxtx serial communication library (downloaded from cloudhopper) with 64bit windows 7 and eclipse. I get the message:
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path. The dlls are in the /jre/lib dir as well as the Windows/System32. The RXTXcomm.jar is in the build path for eclipse as well as in the jre/lib/ext dir. I ran process monitor in the background and and see that RXTXcomm.jar, rxtxSerial.dll, and rxtxParallel.dll are all found and have been opened, So I am unclear as to why this problem is occurring.
Any suggestions.
Go to Project -> properties -> Java build path ->Find your .jar.
Click on + to open the JAR's properties.
Select Native library location and edit it to point to RXTX's shared library (.DLL, .so, .dylib).
You can install librxtx-java package from repo for Ubuntu.
You can also add a virtual machine argument:
-Djava.library.path=c:\path\to\dll\
or
-Djava.library.path=/path/to/lib/
That worked for me. Also refer to this question.
Windows user : my problem was actually that I was placing the rxtxSerial.dll and the rxtxParallel.dll files in the wrong directory.
In my case, they were in [...]/jdk1.7.0_09/bin/ instead of [...]/jre7/bin/, although paths may differ for different versions of Java.
After all it's logic, if we want our JAR to run outside our IDE, we must have the dlls in our java running environment, not in our development environment :)
I resolve this problem by adding rxtxSerial.dll[jre 1.8.0_45/bin] and RxTxcomm.jar[jre 1.8.0_45/lib/ext]
Hy, I had the same problem when integrating the RXTXcomm into Netbeans under Ubuntu 11.10.
I am guessing that you are not copying the files in the right place, at least that was my problem.
Under Ubuntu java is installed under usr/lib/jvm. BUT here I had a lot of forders (ex java-7-openjdk-i386, java-7-common, java-6-openjdk ...). In Netbeans I check what is the path of the JDK included into the project, it was java-7-openjdk-i386 . so I took the rxtxSerial.so (under windows it is rxtxSerial.dll) and copied it to java-7-openjdk-i386/jre/bin and it worked like a charm .
I hope this helps.
I was having the same problem even after installing the RXTXcomm.jar in the Java\jdk\lib directory. Based on the instructions at http://www.jcontrol.org/download/readme_rxtx_en.html
I located the rxtxSerial.dll and the rxtxParallel.dll files. Placing them in the bin directory did not help, but placing them in the lib directory along with the RXTXcomm.jar solved the problem.
I had the same problem. So I installed JDK 32-bit and added those RxTx files(x86) to Program files(x86)/java/... folder instead of Program files/java... folder. Also I added those RxTx .dll files(x86) to /System32 folder. After that the problem was resolved in my application.
FIXED:
when using IDE such Netbeans it has it's own directory for the JRE, were you probably installed your RXTX drivers, but when running the JAR file outside your IDE this error occurs...
Solution is install the RXTX drivers also inside the JAVA JRE directory which use to run all your JAR files.
Under Netbeans 5.5 on Windows, I needed to right-click Libraries under
Projects on the left hand side of the screen, and select "Add
JAR/Folder", picking the RXTXcomm.jar file. Only then did my
enter code here
become a valid command.
Also, I got a run-time error where it failed to load the
rxtxSerial.DLL library because it couldn't find it. I needed to
right-click the project name, select properties, select Run under
categories, and add a VM Options: entry of
-Djava.library.path="C:\where-ever-you-stuck-rxtxSerial.DLL-file;%PATH%
Example:
-Djava.library.path="C:\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\;%PATH%"
While I'm sure there is more than one way of adding the directory to
your path, this worked for me. Note I did the default NetBeans 5.5/JDK
1.6.0 isntall accepting all the default options(ie clicking next until I got to finish), so I haven't modified my java paths or anything.
Alternatively you can copy the *.dll into C:\Windows\System32\, Java
will find it there automatically.
Note that you cannot use the 32bit DLL when running a 64bit JRE:
You will get an error similar to:
Can't load IA 32-bit .dll on a AMD 64-bit platform thrown while loading gnu.io.RXTXCommDriver
To solve this simply install the 32bit JDK and add a new Platform in
Netbeans under Tools->Java Platforms->Add Platform and change the
project settings to use the newly created platform. make sure you type
"import gnu.io.*"
from http://rxtx.qbang.org/wiki/index.php/Using_RXTX_In_NetBeans
I had the same issue, on windows 10 and eclipse, the probelm was i had java for 32 and 64 bits, so i installed RXTX library for 64 bits but eclipse was using the 32 bits java enviroment, so what i did was download RXTX for 32 bits copy the necessary files to C:ProgramFilesx86/JAVA_HOME as in the instructions for RXTX and the problem was solved. Hope this helps anyone.
I had same problem. I was trying to run built jar file from dist folder and it was not working even it was working from NetBeans IDE. I copied rxtxSerial.dll file in dist folder where my main jar file was and it started working fine.
I was having this error before:
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while
loading gnu.io.RXTXCommDriver
Exception in thread "Thread-7" java.lang.UnsatisfiedLinkError: no rxtxSerial 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 gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.smslib.helper.CommPortIdentifier.<clinit>(CommPortIdentifier.java
:72)
at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java
:69)
at org.smslib.modem.AModemDriver.connect(AModemDriver.java:114)
at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:189)
at org.smslib.Service$1Starter.run(Service.java:277)
My Java Application has JNI dll to be loaded at the beginning and we are using system.load() to load DLL with its full path. We have compiled the Java code with 64 bit JDK and dll we are trying to load is also compiled as 64 bit.
When i try to launch the Java application using java.exe at c:\windows\system32, it is successful in launching the application and when i try to launch the same Jar using the java.exe which is located in installed location i.e., %programfiles%\java\jre7\bin then it is failing with error "UnsatisfiedLinkError: The specified procedure could not be found".
Can anybody explain the difference between java.exe available in c:\windows\system32 and at installed location?
There is no difference between the two executables; They are one and the same. Your problem is your DLL location relevant to where you start the Java Environment.
The property java.library.path needs to modified to point to where your DLL is located. You can alter this property by passing -Djava.library.path=
Finally my problem is solved.
Actual problemis with libxml2. my applicat9on has dependency on libxml2. JRE 1.7.07 onards started using libxml2 and shipped into JRE location. hence there is conflict between different libxml2 DLLs. I have modified the application to load libxml2 dynamically and removed dependency.
Kinda new posting up questions here so bear with me. I had to install a XP VM recently in order to run a program that required use of an Oracle 10g client. I setup my tomcat server and when I went through the directory and started the .jsp file, I got this error
2011-02-22 09:13:01,291 ERROR (org.apache.jasper.compiler.Compiler:394) - Javac exception
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
Weird thing is I set my JAVA_HOME variable in my VM to 'C:\Program Files\Java\jdk1.6.0_24;' and my PATH variable to '%JAVA_HOME%\bin;'.
It says that its a jasper-complier error... I made sure to add several TOMCAT_HOME variables in my eclipse library path that looked at the jasper-compiler,jasper-runtime,jsp-api.jar, and servlet-api.jar located in my tomcat server folder.
I also followed these instructions here, that state to add the jdk\bin's tools.jar to Eclipse's Ant runtime global entries
Any help appreciated, I'm stumped.
It usually happens because Oracle ships with an outdated version of JDK which conflicts the PATH that we set. Scan your PATH environment variable for any oracle JDK and remove it. It should help.
Look into your Launcher configurations (of type 'Apache Tomcat') and find the one created when you launched the JSP. There must be an 'environment tab'. You could define the JAVA_HOME here. Is this a version 5 of Tomcat (or earlier) ? Starting with version 5.5, Jasper has an embedded JDT (eclipse java compiler).
Hey I figured it out, just made sure you add to your JDK to your PATH variable (ie. java\jdk...\bin) and I also added it to my tomcat\lib folder and added it to my projects library as another variable.
I was trying to run a project in my local machine.
I tried to load this jnilib file which I got from a running instance of this project on my Mac 10.6.2,
System.load(lib.getAbsolutePath());
then I got this exception thrown:
java.lang.UnsatisfiedLinkError, mach-o but wrong architecture
I have check the jnilib with file command:
libScreenMatchProxy.jnilib: Mach-O dynamically linked shared library i386
I guess this is because the jnilib file is compiled in 32bit but the Java comes with Mac10.6 is 64bit. So I go to Java Preference and set Java to use 32bit first. But it didn't work.
As mentioned above, this jnilib file is copied from a running instance of the project on my Mac, so it should work. I don't understand why it working in the installed application but not in my Eclipse.
Adding "-d32" to the VM argument from Run Configuration will force Eclipse to call Java in 32bit mode. That will solve this problem.