$ CLASSPATH on ubuntu

0

export CLASSPATH = $ CLASSPATH: /usr/share/java/mysql.jar

This establishes the class path for the terminal. If I close that terminal window and start a new terminal window, I currently have to fire command to establish classpath. I want to configure it to be permanent. How I can get this?

    
asked by Cathy Charles 28.05.2017 в 20:10
source

1 answer

1

Environment variables are inherited from parent to child. If you open a shell (bash) in a terminal in a graphical environment, this shell is a child of the process that runs the graphical environment. Therefore, any environment variable that you define or change in your terminal will only be seen in that terminal and in the child processes of that shell.

If you want a modification of an environment variable to be "global" and / or "persistent", there are several alternatives according to your scenario.

One is to set the variable in the user initialization file that will open the terminal. For example, in ~/.profile These settings will be applied every time the user opens a new shell (in graphic terminal or not).

The other is to set the variable globally, at the system level. This can be done (in Ubuntu and several other Linux) in the files    /etc/profile.d/*.sh or   /etc/environment

For details, see the documentation here .

    
answered by 28.05.2017 в 20:30