classpath其实很简单,就是存放资源的一个地方,一般就是target下的目录加上jar包。因为编译过的.class文件都是存放在target文件夹下面的嘛。通过java.class.path就可以查看。

String[] split = System.getProperty("java.class.path").split(";");
Arrays.stream(split).forEach(System.out::println);

当运行程序的时候,一般都会先从当前目录开始找,再从classpath下找,就是去target目录和jar包下去找生成好的.class文件,或者配置文件之类的。

相关文章:

  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2021-07-26
  • 2021-07-31
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-17
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案