"update classpath" 在 Java 或 SpringBoot 中是什么意思?
What is "update classpath" mean in Java or SpringBoot?
我正在阅读 Spring boot reference guide about the developer tools,它提到了以下内容:
As DevTools monitors classpath resources, the only way to trigger a restart is to update the classpath. The way in which you cause the classpath to be updated depends on the IDE that you are using. In Eclipse, saving a modified file will cause the classpath to be updated and trigger a restart. In IntelliJ IDEA, building the project (Build → Make Project
) will have the same effect.
我很困惑,"update the classpath"是什么意思?更准确地说:
- 如果我修改 IDE 中的文件,它似乎不会更新类路径,这是否正确?
- 如果我在 IntelliJ 中单击 "Build",它似乎确实更新了类路径,但 IDE 究竟做了什么?
明确地说,class路径指定项目中用户定义的classes 的位置(路径)。通常,当更改 class(文件)以查看操作中的更改时,需要手动重新启动 Spring 启动应用程序。
如您所述,spring-boot-devtools
提供 Automatic Restart:
Applications that use spring-boot-devtools automatically restart whenever files on the classpath change. This can be a useful feature when working in an IDE, as it gives a very fast feedback loop for code changes. By default, any entry on the classpath that points to a folder is monitored for changes. Note that certain resources, such as static assets and view templates, do not need to restart the application.
As DevTools monitors classpath resources, the only way to trigger a restart is to update the classpath. The way in which you cause the classpath to be updated depends on the IDE that you are using. In Eclipse, saving a modified file causes the classpath to be updated and triggers a restart. In IntelliJ IDEA, building the project (Build -> Build Project) has the same effect.
意思是,使用 IntelliJ,在构建项目时(从而更新 class路径),开发工具将触发应用程序的重启。更简单的是,还可以将 IntelliJ 设置为自动构建并激活 compiler.automake.allow.when.app.running
().
我正在阅读 Spring boot reference guide about the developer tools,它提到了以下内容:
As DevTools monitors classpath resources, the only way to trigger a restart is to update the classpath. The way in which you cause the classpath to be updated depends on the IDE that you are using. In Eclipse, saving a modified file will cause the classpath to be updated and trigger a restart. In IntelliJ IDEA, building the project (
Build → Make Project
) will have the same effect.
我很困惑,"update the classpath"是什么意思?更准确地说:
- 如果我修改 IDE 中的文件,它似乎不会更新类路径,这是否正确?
- 如果我在 IntelliJ 中单击 "Build",它似乎确实更新了类路径,但 IDE 究竟做了什么?
明确地说,class路径指定项目中用户定义的classes 的位置(路径)。通常,当更改 class(文件)以查看操作中的更改时,需要手动重新启动 Spring 启动应用程序。
如您所述,spring-boot-devtools
提供 Automatic Restart:
Applications that use spring-boot-devtools automatically restart whenever files on the classpath change. This can be a useful feature when working in an IDE, as it gives a very fast feedback loop for code changes. By default, any entry on the classpath that points to a folder is monitored for changes. Note that certain resources, such as static assets and view templates, do not need to restart the application.
As DevTools monitors classpath resources, the only way to trigger a restart is to update the classpath. The way in which you cause the classpath to be updated depends on the IDE that you are using. In Eclipse, saving a modified file causes the classpath to be updated and triggers a restart. In IntelliJ IDEA, building the project (Build -> Build Project) has the same effect.
意思是,使用 IntelliJ,在构建项目时(从而更新 class路径),开发工具将触发应用程序的重启。更简单的是,还可以将 IntelliJ 设置为自动构建并激活 compiler.automake.allow.when.app.running
(