Home  >  Article  >  What does . in classpath represent?

What does . in classpath represent?

anonymity
anonymityOriginal
2019-05-08 13:50:507363browse

"." indicates the current directory, which is the .class file in the directory where you are when compiling or executing the program; and JAvA_HOME indicates the JDK installation path

What does . in classpath represent?

The path is passed in in the form of vmarg in eclipse. You can open the command line in the task manager to see it. Now let's experiment and print out the current path to see what it looks like.

The path where the AAA.java file is located

package Test;
class AAA{
    public static void main(String[] args) throws URISyntaxException {
     //这里输出的就是当前文件
        System.out.println(ClassLoader.getSystemClassLoader().getResource(".").toURI().getPath());
    }
}

The output result is: /F:/bupt/project/leetcode/out/production/ leetcode/

About ".", in DOS and Linux, it represents the current directory, ".." represents the upper-level directory of the current directory

./ is the current directory

../is the previous directory

../../is the previous directory

The above is the detailed content of What does . in classpath represent?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What does jpg mean?Next article:What does jpg mean?

Related articles

See more