LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-28-2006, 08:12 PM   #1
canuck_barlow
Member
 
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:

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.
 
Old 09-28-2006, 08:29 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
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
 
Old 09-28-2006, 10:50 PM   #3
jstephens84
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.
Code:
ln -s /usr/java/jdk1.5.0_08/bin/javac /usr/bin/javac
 
Old 09-29-2006, 02:25 AM   #4
IBall
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:
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
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:22 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration