What are the roles of environment variables path and classpath?

Source: Internet
Author: User

A very small problem was raised here. I heard a very serious problem when I attended the training on Chuanzhi podcast. A girl has been studying Java for a month, and cannot even configure an environment variable! I was surprised to hear that. What is this? After learning how to configure environment variables for a month, I cannot configure any environment variables! You have to ask yourself if you want to configure it. Fortunately, I will configure it! In fact, it is really easy to configure an environment variable, mainly the configuration of the path and classpath variables. I will not talk about it here. I want to talk about another question. What are the roles of these two environment variables? I would like to share with you the following:

  Path Environment variable: Specifies the command search path.  DoS Enter Javac When the program is compiled, it will Path Find the corresponding command program in the specified path. Set  JDK Under the installation directory Bin Add directory  Path In environment variables, Bin Contains commonly used executable files  Java , Javac ,  Javadoc After setting, you can execute  Java , Javac And so on. Casspath  Environment variable: used to specify the search path of the class.  Java Class, you must first find them Java Virtual Machine ( JVM  ) Is through  Classpath Environment variables to find the class, we need  JDK Subdirectory under the directory Lib Directory  Rt. Jar Set Classpath Note: The Current Directory  "."  Also add to this directory

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.