V2EX  ›  英汉词典

Classpath

释义 Definition

Classpath:在 Java 等运行环境中,用来告诉编译器或 JVM(Java 虚拟机)到哪里去查找 类(.class) 以及相关资源(如配置文件)的路径集合。通常由一个或多个目录、JAR 文件组成。

发音 Pronunciation

/ˈklæsˌpæθ/

例句 Examples

The program can’t start because the library isn’t on the classpath.
程序无法启动,因为那个库没有加入 classpath。

After adding the JAR to the classpath, the application compiled and ran successfully, even though the dependency was not installed system-wide.
把那个 JAR 加入 classpath 之后,应用就能成功编译并运行了,即使该依赖并没有在系统范围内安装。

词源 Etymology

Class + path 的合成词:class 指 Java 的“类”,path 指“路径”。随着 Java 生态中大量依赖以目录或 JAR 包形式分发,需要一种机制让编译与运行时都能定位这些类文件,于是形成了 classpath 这一术语。

相关词 Related Words

文学与著作中的用例 Literary Works

  • Effective Java(Joshua Bloch)中在讨论类库使用、发布与运行环境配置时会涉及 classpath 等概念。
  • Java Concurrency in Practice(Brian Goetz 等)在示例代码与工程运行说明中常会提到将依赖加入 classpath 的做法。
  • Head First Java(Kathy Sierra, Bert Bates)在面向初学者解释 Java 程序运行与库文件使用时也会出现 classpath。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   920 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 22ms · UTC 19:09 · PVG 03:09 · LAX 11:09 · JFK 14:09
♥ Do have faith in what you're doing.