Classpath explain (now dedicated to a friend who could not find North) (1)

  Class path settings 

  Structure 

  JDK tools can be used to - classpath option (the preferred method) or the provision of CLASSPATH environment variable to set the path category. 

  C:> jdkTool-classpath path1; path2 … 

  C:> set CLASSPATH = path1; path2 … 

  Each path to the end of the file name or directory, the directory on the file name or path will be installed into any category: 

  For contain. Class document. Zip or. Jar file, the path to. Zip or. Jar at the end of the file name. 

  The unnamed in the packet. Class document, the road to cover. Class at the end of the directory. 

  The name has been included in the. Class document, the path to include the "root" package (complete package of the first of a package) at the end of the directory. 

  With a semicolon to separate projects.    The use of set order, omitting the need space on both sides of the equal sign (=).    JdkTool which can be java, javac, javadoc, and so on.    The detailed list, see JDK development tools. 

  Note 

  Java class path tells where to find applications, and third-party custom category - that is not Java expansion or part of the Java platform category.    In JDK 1.2, JDK tools and other JVM followed by the search platform, and expansion of the path to find category (the search strategy detailed information, see how to find). 

  Most applications will take full advantage of the class library expansion mechanisms.    Therefore, only want to load a class library (a) not in the current directory or its branch package and (b) not specified by the mechanism in the extended position when it is set to type path. 

  If users upgrade from the old version JDK come activated settings may include no longer required CLASSPATH set up.    At this time should remove any non-application-specific settings.    Some use the Java Virtual Machine third party application may change CLASSPATH environment variable to include the use of class libraries.    Such settings can be retained. 

  By calling JVM or other JDK tools using Java tools - classpath option of changing path (for example: java-classpath …).    This is the path of change in the method of choice.    Also through the use of CLASSPATH environment variable path of change. 

  NOTE: JDK 1.2 is the default path of the current directory.    CLASSPATH variable settings or use - classpath command line switch will cover the default value, thus If you want to include in the search path in the current directory, it must be included in the new set up. "." 

  Type can be stored in the directory (folder) or archiving documents (such as classes.zip or classes.jar).    The archiving of documents detailed information and path of the working principle of this document see the final path of understanding and a packet. 

  Important Note: JDK old version of the default path also includes / classes items.    JDK use the directory only, not for application category.    Applications should be placed in the category of external JDK directory.    In this way, when the installation of a new JDK not need to re-install the application.    To the old version of the compatibility, use / classes directory of the application as a class library in the current version still running, but it can not guarantee that in future versions of them can also run. 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Tags:

Releated Java Articles

Comments

Leave a Reply