Setting CLASSPATH permanently

寵の児 提交于 2019-12-01 13:16:47

The variable you set in a terminal, is valid only for that terminal. What you should do is, export the variable in your ~/.bashrc file, which is loaded for each terminal. So, add that statement in the .bashrc file, and you'll be fine.

You can also export the variable from ~/.bash_profile file, which will be loaded for login shells.

for bash, add the following lines to this file (~/.bashrc):

PATH=[your path]:$PATH export PATH

for more details check PATH and CLASSPATH

  1. Type nano .bashrc 2.Go to the end of line and type ->export CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java.jar(It is the location where you have stored .jar file that you have downloaded). 3.It becomes permanent now
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!