当前目录中的java类文件? [英] java class files in current directory?

查看:63
本文介绍了当前目录中的java类文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

java如何知道要在不设置类path.ie的情况下执行的类文件。它是否默认检查当前目录,或者我们也需要设置当前目录的类路径。

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.

推荐答案

它首先检查当前目录。如果找不到该类,它将在类路径中搜索该类。

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


默认的类路径是当前目录。设置 CLASSPATH 变量或使用 -classpath 命令行选项会覆盖该默认值,因此如果要包含在搜索路径中的当前目录中,您必须在新设置中包含。 [来源]

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类文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆