“java”如何在不设置类路径的情况下知道要执行的类文件。即,它是默认检查当前目录还是我们也需要为当前目录设置类路径。
最佳答案
它首先检查当前目录。如果找不到该类,它会在类路径中搜索该类。
The default class path is the current directory. Setting the
CLASSPATH
variable or using the-classpath
command-line option overrides that default, so if you want to include the current directory in the search path, you must include"."
in the new settings. [source]
关于当前目录中的java类文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3706689/