adding commands to /bin (root user)
Hi everyone,
I am trying to add commands such as: javac, java etc. to ' /bin' so that everyone can use them. Simply copying the commands is not adding them I've tried that already. Does anyone know how to do it. I am new to Linux (just installed fedora core yesterday). Thank you |
Hi and welcome to LQ!
The best solution is probably adding the bin dir of the Java SDK to your $PATH environment variable. The $PATH is a list of directories that will be searched for executables, and you can set it globally or just for yourself. In the file /etc/profile you can add a line that goes something like this: Code:
export PATH=$PATH:/usr/local/j2sdk-1.4.02_03/bin Then simply log out and log in again and you should be able to type javac (or whatever) at the prompt and it will launch and function as expected. For programs that you install manually you shouldn't use /bin or /usr/bin - drop them in /usr/local/bin since that's what the /usr/local tree is for - locally built software. Håkan |
You can also find the binary and make a shell script within the /usr/bin directory that looks like this.
cd /usr/local/path-to-binary's-folder ./binaryname |
Both the java and javac commands are useless without passing parameters to them, and with that shellscript the parameters wouldn't be passed at all.
Håkan |
Hakan, thank you for yor response. It worked! And Pwnx3r, I did not try your method b/c the other one already worked and it sounds a littlbe bit complicated too, but thank you for suggesting it anyway.
bp |
All times are GMT -5. The time now is 06:37 PM. |