gpt4 book ai didi

java - 在 macOS (Mac OS X) 上打印 Java 类路径

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:14:27 24 4
gpt4 key购买 nike

在命令行上,如何查看包含当前 Java classpath 的所有文件夹和文件? ?

Oracle Tutorial说在类 Unix 系统上使用 echo $CLASSPATH。但是在装有 Java 8 的 Mac (El Capitan) 上什么也不打印。我记得,默认情况下 CLASSPATH 环境变量不在 macOS 上使用。

我看到了一些问题,例如 this显示设置类路径,但我只想验证类路径。

是否有一些从命令行检查当前类路径的简单方法?

最佳答案

除非您在当前 shell 或您的登录配置文件中显式设置 CLASSPATH 变量(例如 ~/.bash_profile),否则无法显示什么是的。

If you don't have the CLASSPATH set, then the default value of the class path is ".", meaning that only the current directory is searched. Specifying either the CLASSPATH variable or the -cp command line switch overrides this value.

关于java - 在 macOS (Mac OS X) 上打印 Java 类路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38258423/

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