I have a GUI application that relies on a console-only executable called 'abc', which requires an older version of some shared libraries. The issue I'm facing is that when I set the LD_LIBRARY_PATH environment variable normally using the command `export LD_LIBRARY_PATH='/path_older_shared_library:$LD_LIBRARY_PATH'` and then run the application with `java -jar /path_to_jar_file`, the 'abc' executable still sees the newer versions of those shared libraries. It works fine when I add the export line to my ~/.bashrc, but that globally affects all software, which could create compatibility issues. I can't modify the executable's path from the GUI, so I'm looking for a solution that allows the 'abc' executable to see the older shared libraries without affecting other applications. Any suggestions?
4 Answers
Instead of exporting the environment variable directly, try this command format: `LD_LIBRARY_PATH=/your/lib/path:/another/path ./your_executable`. You can also create an alias for your shell to make it easier: `alias your_executable='LD_LIBRARY_PATH=/your/lib/path:/another/path /full/path/to/your_executable'`. This lets you run your command with the modified path without changing the global environment.
You can set the environment variable right when you execute the program without needing 'export'. For example, if you do `LD_LIBRARY_PATH=/path/to/libs ./abc`, it will only affect that execution. If you are using different programming languages to run the executable, just make sure to set the environment variable appropriately in that context.
You can try using a wrapper script for your executable. Just rename 'abc' to something like 'abc.real', then create a new script called 'abc' that sets the LD_LIBRARY_PATH and then runs 'abc.real'. This way, only the wrapper will know about the old shared libraries, leaving the rest of your system unaffected.
Just a quick tip: As for how the shared libraries are named, if they're using symlinks named the same but pointing to different versions (like 'lib-shared-library.so' pointing to version-numbered files), that can cause problems. Make sure the regular library names are not conflicting across your applications.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures