Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-28-2006, 08:12 PM   #1
Registered: Dec 2004
Distribution: Fedora Core 5
Posts: 64

Rep: Reputation: 15
Adding Commands

How do you make it so you don't have to type in the complete command path? I just installed java and don't really want to write:

everytime I need to compile. I have a feeling all I have to do is add this path to a config file somewhere but I can't remember where.
Old 09-28-2006, 08:29 PM   #2
LQ Guru
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Example of adding a path to your user account. Add a line like this to ~/.bashrc in your home directory.
export PATH=$PATH:/usr/java/jdk1.5.0_08/bin/

Old 09-28-2006, 10:50 PM   #3
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Or you could add a symlink to your /usr/bin.
ln -s /usr/java/jdk1.5.0_08/bin/javac /usr/bin/javac
Old 09-29-2006, 02:25 AM   #4
Senior Member
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
In the case of java - definitely add it to your PATH as Brian1 suggested. The reason for this is that there are other java programs such as java, javac, javadoc ...

Also, I think Fedora comes with GNU Java - which is all in /usr/bin. If you add the java directory to your path thus:
export PATH=/usr/java/jdk1.5.0_08/bin/:$PATH
then entering the java command will result in the correct one being executed.

I hope this helps


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Boot Commands pjpeter Linux - Newbie 6 01-25-2005 08:10 PM
adding my own commands to rc files SizofreNICK Slackware 8 11-07-2004 02:30 AM
adding commands to /bin (root user) xone Linux - Software 4 03-23-2004 12:26 PM
adding commands? megaman Linux - Newbie 2 12-20-2003 03:57 PM
Adding xgamma commands to startup on RH8 HellBound Linux - Software 2 03-12-2003 08:52 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:12 PM.

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