Java classpath - Linux

后端 未结 4 1228
猫巷女王i
猫巷女王i 2020-12-31 10:58

I am trying to understand how classpath really works. After searching around the web this is where I have reached so far:

I have added

export CLASSP         


        
4条回答
  •  佛祖请我去吃肉
    2020-12-31 11:51

    I think you should not put any paths that a local to your home directory in a system wide file. I would leave /etc/environment well alone, unless you provide some changes, that are necessary or beneficial to all users. Put any changes to the CLASSPATH in your .bashrc in your home directory.

      CLASSPATH=$CLASSPATH:/home/foo:/home/foo/Java_code/my_code
      export CLASSPATH
    

    This way you can source it and any newly started bash will have the settings right at once.

提交回复
热议问题