classpath and path.

时间:2023-03-09 14:27:40
classpath and path.

  simply talk about the <path> and the <classpath> in java development.

  when the <path> and <classpath> are not set:

  1. It won't work if we do not set the <path> when trying to compile .java source file,
  2. however,it works if we do not set the <classpath> but the .class file exist in current path  

  when the <path> and <classpath> are set:

  1. the <path> will first check the current path,if no,then check the specified path.
  2. the <classpath> will first check the specified path,if no,then check the current path.

  the <classpath> will  continue to check current path if the <classpath> ends with ";" when no in the specified path,the oppsite situation when the <classpath> does not end with ";".

classpath and path.