Introduction to Programming in Java
4. Installing the Java Development Kit
4.5. For Linux and UNIX
One way to set your path in Linux/Unix is to add a path export to your bash profile.
- In order to do this, first open your bash profile in a text editor. For example,
pico ~/.bash_profile
- Then add this line:
export PATH=$PATH:/usr/local/jdk/bin
Note that the path to the java directory
"/usr/local/jdk/bin" may be different on your machine.
- Restart your shell.