开发者

java class files in current directory?

开发者 https://www.devze.com 2023-01-16 05:23 出处:网络
How \"java\" knows the class file to execute without setting the class path.ie.,Does it check in the current directory by default or we need t开发者_运维问答o set the class path for current directory

How "java" knows the class file to execute without setting the class path.ie.,Does it check in the current directory by default or we need t开发者_运维问答o set the class path for current directory too.


It checks the current directory first. If the class is not found, it searches for that class in the class path.

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]

0

精彩评论

暂无评论...
验证码 换一张
取 消