Compile time vs Run time Dependency - Java

前端 未结 6 1064
野性不改
野性不改 2020-11-28 01:58

What is the difference between compile time and run time dependencies in Java? It is related to class path, but how do they differ?

6条回答
  •  醉酒成梦
    2020-11-28 02:23

    An easy example is to look at an api like the servlet api. To make your servlets compile, you need the servlet-api.jar, but at runtime the servlet container provides a servlet api implementation so you do not need to add servlet-api.jar to your runtime class path.

提交回复
热议问题