“.” Represents the current directory, which is the. class file in the directory where you are compiling or executing the program, while Java_home represents the JDK installation path
The path is passed in as Vmarg in Eclipse, and you can see it in the Task Manager by opening the command line, and now to experiment, print out the current path and see what it looks like.
Aaa.java file path
Content in Aaa.java:
Package Test;
Class aaa{
public static void Main (string[] args) throws urisyntaxexception {
//output Here is the current file
System.out.println (Classloader. Getsystemclassloader (). GetResource ( "."). Touri (). GetPath ());
}
}
The result of the output is:/f:/bupt/project/leetcode/out/production/leetcode/
When running, look for the Test/aaa.class file directly under the path (/f:/bupt/project/leetcode/out/production/leetcode/), which is/f:/bupt/project/leetcode/ Ot/poduction/leetcode/aaa.class files can be.
If we delete the compiled. Class and then run Aaa.java, an error occurs
jdk1.6 above will not need to configure the CLASSPATH, the system will automatically help you configure, you only need to configure Java_home and path is OK, such as my configuration: java_home:e:\java\jdk1.7.0\ path appended;%java_ Home%\bin;%java_home%\jre\bin;
About ".", in DOS and Linux, represents the current directory, "..." Represents the top-level directory of the current directory
./Is the current directory
.. /is the previous directory
.. /.. /is the previous directory
The role of dot '. ' in Java's classpath path