Classpath: What is the difference between classpath * And classpath?

Source: Internet
Author: User

Classpath: What is the difference between classpath * And classpath?

Classpath is essentially the root path of jvm. resources obtained by jvm are all found under this root path. Note that this root path is a logical path rather than a disk path. For example, the paths of the two jar packages are/a. jar and/B. jar, but the resources in these two jar packages can be found using classpath.

 

Generally, the classpath points to the classes, that is, the root path of the compilation path. Generally, these files are stored in the classes:

1. The class file compiled by the java file.

2. properties configuration file.

3. xml configuration file.

4. Some template files, such as *. ftl.

5. other files that need to be obtained using classpath.

 

After understanding what is put in the classpath pointing to, let's take a look at the difference between classpath: And classpath.

1. classpath: only find the file in your classes path.
2. classpath *: not only the classes path, but also the classes path in the jar file.

 

Refer:

  • The difference between classpath * And classpath when Spring loads resources http://blog.163.com/ygplpr@126/blog/static/389691162012116102750608/
  • Method http://blog.csdn.net/kkdelta/article/details/5560210 for JAVA to read external resources

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.