"." 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
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!