My java files are in /home/joe/Learning/Java folder, but can not run them in home directory. Works fine when I change to the specific directory. How can I add this to my $PATH. I tried so many. but no avail. Can someone help
Asked
Active
Viewed 381 times
-1
-
Did you right click the file choose properties and make it executabe – Mark Kirby Aug 24 '14 at 09:04
1 Answers
3
If you want to run files locally without adding the path to your command, an easy way is to store them in ~/bin
.
Make sure they are executable.
Another way is to create a link in ~/bin
to the file (ln -sf
)
I think this is the most appropriate way for a "learning" file as you mention it.

Jacob Vlijm
- 83,767
-
This is good advice you can move you files from terminal like this sudo cp -R /home/joe/Learning/Java/FILENAMEHERE ~/bin – Mark Kirby Aug 24 '14 at 09:07
-
The sudo will not be needed to copy them locally, and the file needs to be on the first level. – Jacob Vlijm Aug 24 '14 at 09:09