I'm testing out the new version of DDS and it isn't running for me.
I've been following the documentation for setup and running the example pub sub java program. It built fine but running produced this error:
C:\Program Files\rti_connext_dds-5.2.0\resource\template\rti_workspace\examples\connext_dds\java\hello_simple>"C:\Program Files\rti_connext_dds-5.2.0\resource\template\rti_workspace\examples\connext_dds\java\hello_simple\runPub.cmd" The library nddsjava.dll could not be loaded by Windows. Make sure that the library is in your Path environment variable. Exception in thread "main" java.lang.UnsatisfiedLinkError: no nddsjava 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 com.rti.dds.util.NativeInterface.loadNativeLibrary(Unknown Source) at com.rti.dds.util.NativeInterface.loadNativeLibraries(Unknown Source) at com.rti.dds.domain.DomainParticipantFactory.<clinit>(Unknown Source) at com.rti.simple.HelloPublisher.main(HelloPublisher.java:29)
According to the error it can't find nddsjava.dll in the path variable. Here's my %path%:
C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Parallels\Parallels Tools\Applications;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Users\Matt\.posh_gvm\griffon\current;"C:\Program Files\rti_connext_dds-5.2.0\lib\java";"C:\Program Files\rti_connext_dds-5.2.0\lib\x64Win64VS2013";"C:\Program Files\rti_connext_dds-5.2.0\lib\x64Win64VS2013\nddsjava.dll";"C:\Program Files\rti_connext_dds-5.2.0\lib\x64Win64VS2013\nddscore.dll";"C:\Program Files\rti_connext_dds-5.2.0\lib\x64Win64VS2013\nddsc.dll";"C:\Program Files\rti_connext_dds-5.2.0\bin";"C:\Program Files\Java\jdk1.8.0_65\bin"
Little messy because I've been trying to solve this bug on my own for a while. I also have NDDSHOME set.
Any idea how to fix this?
Hi Gan,
Can you try to run the Java application by hand, I think the runPub.cmd script modifies your path already and is doing something funny with it. To run the application manually just do:
Assuming that "C:\Program Files\rti_connext_dds-5.2.0\lib\x64Win64VS2013" contains all the DDS libraries (i.e., you installed that target) it should work. Note that you only need to add that directory to your path, it will automatically find there all the .dll files, so you do not need to add these to your path.
Please, let me know if this works and we can try to find identify problem in the runPub.cmd file.
Thanks,
Fernando.
Hi Gan,
In addition to Fernando's comments I was wondering if your plaform is 32 bits or 64 bits. It appears like your PATH mixes 32-bit and 64 bit libraries. If your system (or VM) is 32 bit then you would not be able to load the libraries from x64Win64VS2013 which are for 64 bits.
The other thing that comes to mind are the Visual Studio redistributables. These are Microsoft libraries that are required in your system if you are loading a DLL which was compiled with Visual Studio (which the Connext DDS DLLs were). You can read more details on which ones are required and how to install them from the RTI Connext DDS Windows Platform Notes here.
If the above fails another thing you might want to try is to install the dependencywalker tool which will allow you to see which libraries the nddsjava.dll depens on and whether they can be found in your system.
Gerardo
I tried all of your suggestions(which are very good by the way) and I'm still having issues. I attached a screenshot of the dependency application. Apparently there's a lot of missing dependencies.
Could the problem be that I'm running Windows 10?
I am 64 bit but RTI 64 bit always wants to install in the normal Program Files folder.
Hi Gan,
I think you may be missing the Visual C++ redistributable packages for Visual Studio 2013 (see this question on Stack Overflow). You can download these redistributable packages from Microsoft's website. In particular, you will probably want to download vcredist_x64.exe.
Let us know if this fixes at least the missing dependencies that dependency walker is showing.
Thanks,
Fernando.
I already had that installed so I repaired it using the installer. The dependency walker still shows all the same problems when I open nddsjava.dll. I even installed Visual Studio 2015 to see if that'd help. But it didn't.
I tested the C-Sharp Simple Pub Sub example and it works perfectly. The java version still doesn't work for me. The java example still outputs:
I'll continue googling.
Fixed it. I'm sure it was multiple issues but the last thing I did was change my path variable to include C:\Program Files\rti_connext_dds-5.2.0\. Also made sure all quotation marks were removed from my path variable.
A similar problem is occuring with me Although i have set the path variable it is unable to load the nddsjava.dll . I am using Eclipse . My code is working on Java 9 but when I downgrade it to lower version(Java8) this message pops up
The library nddsjava.dll could not be loaded by Windows.
Make sure that the library is in your Path environment variable.
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\rti_connext_dds-5.3.0\lib\x64Win64VS2015\nddsjava.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.rti.dds.util.NativeInterface.loadNativeLibrary(Unknown Source)
at com.rti.dds.util.NativeInterface.loadNativeLibraries(Unknown Source)
at com.rti.dds.domain.DomainParticipantFactory.<clinit>(Unknown Source)
at HelloWorldPublisher.publisherMain(HelloWorldPublisher.java:124)
at HelloWorldPublisher.main(HelloWorldPublisher.java:94)
Just passing along that I also had a problem with an application needing nddsjava.dll throwing a 'can't load' error. Adding the folder location of the DLL to the end of the Windows path didn't solve the problem. However, adding it to the FRONT of the path did.