zoukankan      html  css  js  c++  java
  • Eclipse 和 MyEclipse 工程描述符

    有时候在一个Java工程里我们需要加入第三方jar包,这时你加入的最好相对路径, 
    而不是绝对路径。否则你的工程拿到别处就不行运行了。意思就是说你最好把相关的jar放到工程目录下。

    对于Web工程来说相对简单,web工程是有个lib目录的。直接复制到这里就行了。

    而非web工程是不可以的。Eclispe是不能自动完成导入copy的。 
    这就需要我们手动配置,对于工作描述文件,Eclipse和MyEclpse全是用xml来描述的。 

    现在我们来看看Eclipse的:

    .classpath文件:

    <?xml version=”1.0” encoding=”UTF-8”?> 
    <classpath> 
    <!-- 源码目录 --> 
    <classpathentry kind=”src” path=”src”/> 
    <!-- JDK运行时容器 --> 
    <classpathentry kind=”con” path=”org.eclipse.jdt.launching.JRE_CONTAINER”/> 
    <!-- 以下为类库path为你自定义的目录 --> 
    <classpathentry kind=”lib” path=”lib/swing-layout-1.0.3.jar”/> 
    <classpathentry kind=”lib” path=”lib/AbsoluteLayout.jar”/> 
    <classpathentry kind=”lib” path=”lib/jtds-1.2.2.jar”/> 
    <classpathentry kind=”lib” path=”lib/jxl.jar”/> 
    <!-- 编译后输出class目录 --> 
    <classpathentry kind=”output” path=”bin”/> 
    </classpath>

    ---------------------------------------------------------------------------

    .project文件:

    <?xml version=”1.0” encoding=”UTF-8”?> 
    <projectDescription> 
    <!-- 工程名称 <name>--> 
    <name>execlInterface</name> 
    <comment></comment> 
    <projects></projects> 
    <!-- 编译器指定 <buildSpec>--> 
    <buildSpec> 
    <buildCommand> 
    <name>org.eclipse.jdt.core.javabuilder</name> 
    <arguments></arguments> 
    </buildCommand> 
    </buildSpec> 
    <!-- 核心特性 <natures> --> 
    <natures> 
    <nature>org.eclipse.jdt.core.javanature</nature> 
    </natures> 
    </projectDescription> 

    --------------------------------------------------------------------------

    对于myeclipse工程多了一个(web 应用程序才有)

    .mymetadata文件:

    <?xml version=”1.0” encoding=”UTF-8”?> 
    <!-- 
    type : 工程类型 
    name : 工程名称 
    id : 工程在工作空间内的唯一标识 
    context-root : 网站根路径 
    j2ee-spec: J2EE标准 
    archive : 打包后war文件 
    --> 

    <project-module 
    type=”WEB” 
    name=”upload” 
    id=”myeclipse.1152954865843” 
    context-root=”/upload” 
    j2ee-spec=”1.4” 
    archive=”upload.war”>


    <attributes> 
      <!-- value : Web根目录名称 --> 
        <attribute name=”webrootdir” value=”WebRoot” /> 
    </attributes>

    </project-module> 

    -------------------------------------------------------------------------




    在eclipse更改工程的发布文件夹 

    可以在自己的workspace中找到当前使用的工程,找到文件.mymetadata,打开后就会看见标签context- root=”/example”(example是自己应用的名称),可以将其改为别的名称,另外也可以在eclipse中改:选中要修改的project,之后在菜单project中选中properties,选中Myeclipse-Web,就可以看见标签context-root即可修改

  • 相关阅读:
    [LeetCode] Swap Nodes in Pairs
    [LeetCode] Merge k Sorted Lists
    [LeetCode] Generate Parentheses
    [LeetCode] Remove Nth Node From End of List
    [LeetCode] Longest Common Prefix
    [LeetCode] Letter Combinations of a Phone Number
    [LeetCode] Roman to Integer
    Apache shiro 笔记整理之编程式授权
    手势跟踪论文学习:Realtime and Robust Hand Tracking from Depth(三)Cost Function
    12.5 管理问题的解决方式
  • 原文地址:https://www.cnblogs.com/rxingyue/p/4071456.html
Copyright © 2011-2022 走看看