Problems with in java, IntelliJ, Ubuntu 14

3 posts / 0 new
Last post
Last seen: 6 years 7 months ago
Joined: 08/03/2015
Posts: 8
Problems with in java, IntelliJ, Ubuntu 14


I'm working in a DDS project in Java under Ubuntu using the IDE IntelliJ IDEA. The program compiles succesfully but when I execute it, under Ubuntu, it fails showing the following error:

The library could not be loaded by Linux.
Make sure that the library is in your LD_LIBRARY_PATH environment variable.

As indicated the error, I checked my LD_LIBRARY_PATH and it's right. LD_LIBRARY_PATH is defined in .bashrc as follows:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NDDSHOME/lib/x64Linux3gcc4.8.2

and the missed library, is in ../x64Linux3gcc4.8.2 directory.

The same program deployed under Windows in java and using the same IDE, InelliJ, works properly.

The others tools such as rtiddsgen or rtiddsspy works perfectly, also I executed some examples provided by RTI webside in terminal without problems.

I belive that is problem of IntelliJ configuration on Ubuntu because under Windows is well configured and I don't know what to do, I have no more ideas to try.


Thanks a lot!

Fernando Garcia's picture
Last seen: 1 month 2 weeks ago
Joined: 05/18/2011
Posts: 200

Hi Marti,

I think since Ubuntu 9.04 you can only set the  LD_LIBRARY_PATH inside an interactive shell (i.e., it cannot be set in files such as ~/.bashrc, ~/.profile, etc.). The best alternative -- if you have admin privileges -- is to create new /etc/*.conf file with the path to RTI's dynamic libraries. In your case, you only need to add the lib/x64Linux3gcc4.8.2 directory (i.e., you do not need to add the jar files to the library path).

The file could be called /etc/ and should look like this:

# RTI shared libraries

Once you have created the file, you need to run ldconfig as follows to cache the dynamic libraries you just added:

sudo ldconfig

Please, let me know if this work for you.


Last seen: 6 years 7 months ago
Joined: 08/03/2015
Posts: 8

Hi Fernando,

Excuse me for having taken so long to ansewer. Your advise works perfectly. Since the file.conf is defined, the declaration of LD_LIBRARY_PATH in .bashrc is useless.

Thank you Fernando.