java class files in current directory?

给你一囗甜甜゛ 提交于 2019-11-27 03:42:15

问题


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 to set the class path for current directory too.


回答1:


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]



来源:https://stackoverflow.com/questions/3706689/java-class-files-in-current-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!