eclipse java build path


Source:源文件和输出文件目录,如果创建一个项目时,没有分开源文件和输出文件,可以通过这个地方修改;多个源文件可以在一个项目里使用;例如,将应用程序的源代码和Junit测试分开;在src同级目录下创建一个test目录(Folder),在Source下add folder添加test目录,即可在test下创建包和类,否则即使无法创建一个类;

output folder指的是编译后的文件所在目录;

 

Project:使用其他项目的类,使用的类必须已经有对应的.class,否则Eclipse找不到;如果是一个Java Project,手动删除bin下面的所有文件,需要使用clean项目,重新build过,即使选择build auto也不会build。

 

Project Libraries:项目需要使用到的jar(即平时web项目lib下面的jar)。

  • Add JARs. Select archive files located within any project from the current workspace; projects are not required to be Java projects.

  • Add External JARs. Select archive files anywhere on your file system external to the current workspace.

  • Add Variable. Use a Java classpath variable as the base path for external archives.

  • Add Library. Select from a list of user libraries that define collections of related archive files.

  • Add Class Folder. Select any folder from a project in the current workspace that contains Java .class files.

 

Order and export:规定多个jar(项目)有重名的类时,这些类的使用顺序;如果勾选了某个checkbox,则导出项目的文件的.classpath里 checkbox所在项的classpathentry多一个exported="true"的属性,这就意味着多个项目依赖于这个项目类时,可以通过Project Tab添加这个项目的包(When it is exported, it is available to other eclipse projects. In maven, if you have multiple projects that depend on each other, eclipse can resolve projects within the workspace. So changing that is likely to have an effect when you have multiple projects.)

 本篇是学习http://my.safaribooksonline.com/book/software-engineering-and-development/ide/0321288157/java-project-configuration/ch06lev1sec1

后的摘要,本人英文水平有限,如果不正确之处,请指出,谢谢!


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM