LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 03-22-2004, 06:20 PM   #1
xone
LQ Newbie
 
Registered: Mar 2004
Posts: 29

Rep: Reputation: 15
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
 
Old 03-22-2004, 06:30 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 57
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
The line above assumes that the you have the SDK installed to /usr/local/j2sdk-1.4.02_03 - if you have it elsewhere you have to change it to whatever is appropriate for your installation. The $PATH is a colon-separated list, so the line above means "set the $PATH to whatever it was before plus our Java bin directory".

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
 
Old 03-22-2004, 07:54 PM   #3
Pwnz3r
Member
 
Registered: Jan 2004
Location: Lancaster, OH
Distribution: Gentoo
Posts: 393

Rep: Reputation: 30
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
 
Old 03-23-2004, 02:18 AM   #4
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 57
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
 
Old 03-23-2004, 12:26 PM   #5
xone
LQ Newbie
 
Registered: Mar 2004
Posts: 29

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Root/User rights to Root commands? mrde50garfield Linux - Software 2 10-24-2006 05:42 AM
Giving a user (not a root) an access to some system commands asschay Linux - Newbie 8 09-08-2005 05:53 PM
How a ordinary user can run commands having only root privilige in C? shivaligupta Programming 1 01-31-2005 04:24 AM
adding /bin to /home/user emetib Linux - General 9 04-06-2004 06:25 PM
im in user mode and cant run hdparm and ifconfig commands, but if im root, i can. kublador Linux - Newbie 2 09-12-2003 08:27 AM


All times are GMT -5. The time now is 08:14 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration