LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Adding Commands (https://www.linuxquestions.org/questions/linux-newbie-8/adding-commands-487841/)

canuck_barlow 09-28-2006 08:12 PM

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:

Code:

/usr/java/jdk1.5.0_08/bin/javac
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.

Brian1 09-28-2006 08:29 PM

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/

Brian1

jstephens84 09-28-2006 10:50 PM

Or you could add a symlink to your /usr/bin.
Code:

ln -s /usr/java/jdk1.5.0_08/bin/javac /usr/bin/javac

IBall 09-29-2006 02:25 AM

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:
Code:

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
--Ian


All times are GMT -5. The time now is 12:04 AM.