首页 > 编程语言 > 详细

Setting the Java Class Path

时间:2018-05-18 11:02:21      阅读:159      评论:0      收藏:0      [点我收藏+]

  The class path is the path taht Java Runtime Environment(JRE) searches for classes and other resource files.

Synopsis:

  The class serach path (classpath) can  be set suing either the -classpath option when calling a JDK tool( the preferred method) or bby setting the CLASSPATH environment variable.

The -classpath option is preferred beacuse you can set it individually for each application without affecting other applications and without outher applications modifying its value.

sdkTool -classpath classpath1:classpath2...

set CLASSPATH=classpath1;classpath2...

sdkTool

  A command-line tool, such as java, javac, javadoc, or apt.For a listing, see JDK Tools and Utilites at

http://docs.oracle.com/javase/8/docs/technotes/tools/index.html

classpaht1:classpath2

  Classpaths to the JAR,zip or class files.Each class path should end with a file name or directory depending on what you are setting the class path to, as follows:

`For a JAR or zip file that contains class files, the class path ends with the name of the zip or JAR file.

`For class files in an unnamed package, thje class path ends with the direcotry that contains the class files.

`For class files in a named package, the class path ends with the directory that contains the root package, which is the first package in the full package name.

Multiple path entries are separated by semicolons with no spaces around the equals sigh (=) in windows.

The defalut class path is the current direcoty. Setting the CLASSPATH variable or using the -classpath command-line option overrides that default, so if you want to include the current direcoty in the search path,

then you must include a dot(.) in the new settings.

Class path entries that are neither directories nor archives (.zip or JAR files) nor the asterisk(*) wildcard character are ignored.

Setting the Java Class Path

原文:https://www.cnblogs.com/zienzir/p/9054884.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!