gpt4 book ai didi

java - Ide CLASSPATH 与系统范围的 CLASSPATH

转载 作者:行者123 更新时间:2023-12-02 00:27:04 27 4
gpt4 key购买 nike

将 JAR 添加到 IDE 中项目的 CLASSPATH 与将其添加到系统范围的 CLASSPATH 之间有什么区别?

最佳答案

后者对您正在运行的所有 java 应用程序都有效,而前者仅对项目有效。我建议不要使用系统范围的类路径,因为事情很快就会变得相当困惑和困惑。

从这里开始:

PATH and CLASSPATH

Checking the CLASSPATH variable (All platforms)

The CLASSPATH variable is one way to tell applications, including the JDK tools, where to look for user classes. (Classes that are part of the JRE, JDK platform, and extensions should be defined through other means, such as the bootstrap class path or the extensions directory.)

The preferred way to specify the class path is by using the -cp command line switch. This allows the CLASSPATH to be set individually for each application without affecting other applications. Setting the CLASSPATH can be tricky and should be performed with care.

关于java - Ide CLASSPATH 与系统范围的 CLASSPATH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9771842/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com