Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
4 replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
source | link

I am running Debian. I have a jar file that I need to execute. A wrapper bash script does a java -jar MyProg.jar. The jar also calls some C code for which LD_LIBRARY_PATH needs to be set.

I have set LD_LIBRARY_PATH in the current user's (let's say Sriram)'s bashrc like so: export LD_LIBRARY_PATH=myLibLocation.

Everything works as expected when running the above script from the command line. However, when I run the same bash file by double-clicking on it, LD_LIBRARY_PATH is not set. Here is a sample bash script I wrote:

#!/bin/bash
echo `whoami`;
echo "PATH = ${LD_LIBRARY_PATH}"  

It runs as expected from the command line but not when I run it by double-clicking. The output in that case is:

Sriram
PATH =   

ThisThis question is exactly the same as this. I have tried to implement all the suggestions there but have not had success.

Update:

What I tried from the answer to the question I linked to:
1. Created a file ~/.xsessionrc. It did not exist on my system.
2. Set LD_LIBRARY_PATH in the above script.

Restarted a new shell. Re-ran the above script. No changes were observed.

Any help is most welcome.

I am running Debian. I have a jar file that I need to execute. A wrapper bash script does a java -jar MyProg.jar. The jar also calls some C code for which LD_LIBRARY_PATH needs to be set.

I have set LD_LIBRARY_PATH in the current user's (let's say Sriram)'s bashrc like so: export LD_LIBRARY_PATH=myLibLocation.

Everything works as expected when running the above script from the command line. However, when I run the same bash file by double-clicking on it, LD_LIBRARY_PATH is not set. Here is a sample bash script I wrote:

#!/bin/bash
echo `whoami`;
echo "PATH = ${LD_LIBRARY_PATH}"  

It runs as expected from the command line but not when I run it by double-clicking. The output in that case is:

Sriram
PATH =   

This question is exactly the same as this. I have tried to implement all the suggestions there but have not had success.

Update:

What I tried from the answer to the question I linked to:
1. Created a file ~/.xsessionrc. It did not exist on my system.
2. Set LD_LIBRARY_PATH in the above script.

Restarted a new shell. Re-ran the above script. No changes were observed.

Any help is most welcome.

I am running Debian. I have a jar file that I need to execute. A wrapper bash script does a java -jar MyProg.jar. The jar also calls some C code for which LD_LIBRARY_PATH needs to be set.

I have set LD_LIBRARY_PATH in the current user's (let's say Sriram)'s bashrc like so: export LD_LIBRARY_PATH=myLibLocation.

Everything works as expected when running the above script from the command line. However, when I run the same bash file by double-clicking on it, LD_LIBRARY_PATH is not set. Here is a sample bash script I wrote:

#!/bin/bash
echo `whoami`;
echo "PATH = ${LD_LIBRARY_PATH}"  

It runs as expected from the command line but not when I run it by double-clicking. The output in that case is:

Sriram
PATH =   

This question is exactly the same as this. I have tried to implement all the suggestions there but have not had success.

Update:

What I tried from the answer to the question I linked to:
1. Created a file ~/.xsessionrc. It did not exist on my system.
2. Set LD_LIBRARY_PATH in the above script.

Restarted a new shell. Re-ran the above script. No changes were observed.

Any help is most welcome.

    Post Closed as "duplicate" by Gilles bash of
3 added 2 characters in body
source | link

I am running Debian. I have a jar file that I need to execute. A wrapper bash script does a java -jar MyProg.jar. The jar also calls some C code for which LD_LIBRARY_PATH needs to be set.

I have set LD_LIBRARY_PATH in the current user's (let's say Sriram)'s bashrc like so: export LD_LIBRARY_PATH=myLibLocation.

Everything works as expected when running the above script from the command line. However, when I run the same bash file by double-clicking on it, LD_LIBRARY_PATH is not set. Here is a sample bash script I wrote:

#!/bin/bash
echo `whoami`;
echo "PATH = ${LD_LIBRARY_PATH}"  

It runs as expected from the command line but not when I run it by double-clicking. The output in that case is:

Sriram
PATH =   

This question is exactly the same as this. I have tried to implement all the suggestions there but have not had success.

Update:

What I tried from the answer to the question I linked to:
1. Created a file ~/.xsessionrc. It did not exist on my system.
2. Set LD_LIBRARY_PATH in the above script.

Restarted a new shell. Re-ran the above script. No changes were observed.

Any help is most welcome.

I am running Debian. I have a jar file that I need to execute. A wrapper bash script does a java -jar MyProg.jar. The jar also calls some C code for which LD_LIBRARY_PATH needs to be set.

I have set LD_LIBRARY_PATH in the current user's (let's say Sriram)'s bashrc like so: export LD_LIBRARY_PATH=myLibLocation.

Everything works as expected when running the above script from the command line. However, when I run the same bash file by double-clicking on it, LD_LIBRARY_PATH is not set. Here is a sample bash script I wrote:

/bin/bash
echo `whoami`;
echo "PATH = ${LD_LIBRARY_PATH}"  

It runs as expected from the command line but not when I run it by double-clicking. The output in that case is:

Sriram
PATH =   

This question is exactly the same as this. I have tried to implement all the suggestions there but have not had success.

Update:

What I tried from the answer to the question I linked to:
1. Created a file ~/.xsessionrc. It did not exist on my system.
2. Set LD_LIBRARY_PATH in the above script.

Restarted a new shell. Re-ran the above script. No changes were observed.

Any help is most welcome.

I am running Debian. I have a jar file that I need to execute. A wrapper bash script does a java -jar MyProg.jar. The jar also calls some C code for which LD_LIBRARY_PATH needs to be set.

I have set LD_LIBRARY_PATH in the current user's (let's say Sriram)'s bashrc like so: export LD_LIBRARY_PATH=myLibLocation.

Everything works as expected when running the above script from the command line. However, when I run the same bash file by double-clicking on it, LD_LIBRARY_PATH is not set. Here is a sample bash script I wrote:

#!/bin/bash
echo `whoami`;
echo "PATH = ${LD_LIBRARY_PATH}"  

It runs as expected from the command line but not when I run it by double-clicking. The output in that case is:

Sriram
PATH =   

This question is exactly the same as this. I have tried to implement all the suggestions there but have not had success.

Update:

What I tried from the answer to the question I linked to:
1. Created a file ~/.xsessionrc. It did not exist on my system.
2. Set LD_LIBRARY_PATH in the above script.

Restarted a new shell. Re-ran the above script. No changes were observed.

Any help is most welcome.

2 added more information.
source | link

I am running Debian. I have a jar file that I need to execute. A wrapper bash script does a java -jar MyProg.jar. The jar also calls some C code for which LD_LIBRARY_PATH needs to be set.

I have set LD_LIBRARY_PATH in the current user's (let's say Sriram)'s bashrc like so: export LD_LIBRARY_PATH=myLibLocation.

Everything works as expected when running the above script from the command line. However, when I run the same bash file by double-clicking on it, LD_LIBRARY_PATH is not set. Here is a sample bash script I wrote:

/bin/bash
echo `whoami`;
echo "PATH = ${LD_LIBRARY_PATH}"  

It runs as expected from the command line but not when I run it by double-clicking. The output in that case is:

Sriram
PATH =   

This question is exactly the same as this. I have tried to implement all the suggestions there but have not had success.

Update:

What I tried from the answer to the question I linked to:
1. Created a file ~/.xsessionrc. It did not exist on my system.
2. Set LD_LIBRARY_PATH in the above script.

Restarted a new shell. Re-ran the above script. No changes were observed.

Any help is most welcome.

I am running Debian. I have a jar file that I need to execute. A wrapper bash script does a java -jar MyProg.jar. The jar also calls some C code for which LD_LIBRARY_PATH needs to be set.

I have set LD_LIBRARY_PATH in the current user's (let's say Sriram)'s bashrc like so: export LD_LIBRARY_PATH=myLibLocation.

Everything works as expected when running the above script from the command line. However, when I run the same bash file by double-clicking on it, LD_LIBRARY_PATH is not set. Here is a sample bash script I wrote:

/bin/bash
echo `whoami`;
echo "PATH = ${LD_LIBRARY_PATH}"  

It runs as expected from the command line but not when I run it by double-clicking. The output in that case is:

Sriram
PATH =   

This question is exactly the same as this. I have tried to implement all the suggestions there but have not had success.

Any help is most welcome.

I am running Debian. I have a jar file that I need to execute. A wrapper bash script does a java -jar MyProg.jar. The jar also calls some C code for which LD_LIBRARY_PATH needs to be set.

I have set LD_LIBRARY_PATH in the current user's (let's say Sriram)'s bashrc like so: export LD_LIBRARY_PATH=myLibLocation.

Everything works as expected when running the above script from the command line. However, when I run the same bash file by double-clicking on it, LD_LIBRARY_PATH is not set. Here is a sample bash script I wrote:

/bin/bash
echo `whoami`;
echo "PATH = ${LD_LIBRARY_PATH}"  

It runs as expected from the command line but not when I run it by double-clicking. The output in that case is:

Sriram
PATH =   

This question is exactly the same as this. I have tried to implement all the suggestions there but have not had success.

Update:

What I tried from the answer to the question I linked to:
1. Created a file ~/.xsessionrc. It did not exist on my system.
2. Set LD_LIBRARY_PATH in the above script.

Restarted a new shell. Re-ran the above script. No changes were observed.

Any help is most welcome.

1
source | link