eclipse工程中.classpath文件的含义

来源:互联网 发布:vb对象的属性是指 编辑:程序博客网 时间:2024/06/03 07:18

eclipse工程中.classpath文件含义:
下面是一个.classpath文件内容:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
        <!-- 源码目录 --> 
        <classpathentry kind="src" path="src"/>


        <!-- 工程引用外部lib目录(最好用相对路径) -->         
        <classpathentry kind="lib" path="G:/java_ocr/Asprise-OCR-Java-Windows_XP_32bit-4.0/aspriseOCR.jar"/>
        <classpathentry kind="lib" path="lib/xstream-1.3.1.jar"/>
        <classpathentry kind="lib" path="lib/xpp3_min-1.1.4c.jar"/>
        <classpathentry kind="lib" path="lib/commons-logging.jar"/>
        <classpathentry kind="lib" path="lib/htmlparser.jar"/>
        <classpathentry kind="lib" path="lib/jdom.jar"/>
        <classpathentry kind="lib" path="lib/log4j-1.2.8.jar"/>
        <classpathentry kind="lib" path="lib/lucene-1104.jar"/>
        <classpathentry kind="lib" path="lib/mysql-connector-java-5.0.0-beta-bin.jar"/>
        <classpathentry kind="lib" path="lib/xml-apis.jar"/>
        <classpathentry kind="lib" path="lib/nekohtml.jar"/>
        <classpathentry kind="lib" path="lib/xalan.jar"/>
        <classpathentry kind="lib" path="lib/xercesImpl.jar"/>
        <classpathentry kind="lib" path="lib/js.jar"/>
        <classpathentry kind="lib" path="lib/cobra.jar"/>
        <classpathentry kind="lib" path="lib/jdmkrt.jar"/>
        
        <!-- JDK编译时容器 --> 
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_06"/>
        <!-- class 目录 --> 
        <classpathentry kind="output" path="bin"/>
</classpath>

说明:
1、<classpathentry kind="src" path="src"/>
含义:本工程的源码所在地路径--》在当前工程路径下的src文件下
2、<classpathentry kind="lib" path="G:/java_ocr/Asprise-OCR-Java-Windows_XP_32bit-4.0/aspriseOCR.jar"/>
含义:本工程所要应用的外部jar包,具体路径是G:/java_ocr/Asprise-OCR-Java-Windows_XP_32bit-4.0/aspriseOCR.jar这里利用的是绝对路径
注意:我们不要应用绝对路径,这样的话我们load工程的时候就会出现找不到jar包的现象我们要用<classpathentry kind="lib" path="lib/cobra.jar"/>
这种相对路径的格式,都用相对路径,那么当我们利用eclipse从文件load一个已经存在的工程的时候就不用在重新引入jar包了
3、<classpathentry kind="output" path="bin"/>
含义:本工程编译后的类文件存放到当前工程路径下的bin目录下


转自:http://coffeelet.blog.163.com/blog/static/13515745320107249178730/

0 0