- Change to your home directory. cd $HOME.
- Open the . bashrc file.
- Add the following line to the file. Replace the JDK directory with the name of your java installation directory. export PATH=/usr/java/<JDK Directory>/bin:$PATH.
- Save the file and exit. Use the source command to force Linux to reload the .
In this regard, what is export path?
export is a command (more precisely it's a Bash builtin, i.e. it's not an executable present in PATH , it's a command that Bash has built-in in itself). The first PATH as explained above is the environment variable to be set using export .
Also Know, how do I permanently export a path? You may set $PATH permanently in 2 ways.
- To set path for particular user : You may need to make the entry in . bash_profile in home directory in the user.
- To set common path for ALL system users, you may need to set path like this : [root~]# echo "export PATH=$PATH:/path/to/dir" >> /etc/profile.
Likewise, people ask, where do I put export path?
Linux
- Open the . bashrc file in your home directory (for example, /home/your-user-name/. bashrc ) in a text editor.
- Add export PATH="your-dir:$PATH" to the last line of the file, where your-dir is the directory you want to add.
- Save the . bashrc file.
- Restart your terminal.
How do I export a path in Windows?
PATH and CLASSPATH
- Select Start, select Control Panel. double click System, and select the Advanced tab.
- Click Environment Variables. In the section System Variables, find the PATH environment variable and select it.
- In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK.
