What I'm trying to achieve is to run a java program on any Linux system (Ubuntu, Fedora, etc... covering as much as possible) by simply double clicking a file-like I would on Windows.
I have created a .sh file(and granted execute permissions) with the following content:
#!/bin/sh java -Xmx512M\ -Djava.library.path="."\ -DclientAppDataPath="Application Data"\ -jar Client.jar\ Phoenix.client.ClientMain\ 1>output.txt 2>error.txt
If I try to execute this file using the Ubuntu Terminal it works fine. However when I try to double click the file and choose Run or Run in Terminal, I see nothing. Apparently the shell opens and closes immediately. How do I avoid this?
I noticed error.txt contains:
blah/blah/blah/Client Launcher.sh: 2: blah/blah/blah/Client Launcher.sh: java: not found
I have extracted a jdk1.x.x.tar.gz and added java home to PATH manually using .bashrc file. Could this be the cause? How can I fix it?