Eclipse - 导入您自己的库 [英] Eclipse - Importing your own library
问题描述
我该怎么做?
另一方面,这个库项目只存在,因为我想使用我自己的一些类来补充通常的java库(java.util,java.io,etc ...)。有没有办法可以将我的java项目添加到我的java库中? (即'import java.Library.className;')
谢谢,
Jonathan
只要有项目引用你的库,在windows的进程中(使用菜单/选项卡名称)
- 1。转到:项目 - >属性 - > Java构建路径 - >项目
- 2。客户添加...
- 3。从列表
- 4中选择库项目。点击Ok
- 5。点击另一个Ok
现在完成,您可以在库中使用导入到课程
Okay, hopefully this is quick and easy.
I have two separate java projects, 'Library' and 'Project', and I have a class in 'Project' that wants to implement a method found in 'Library'. I am looking for some kind of 'import' call to make at the top of my 'Project' class, to make the methods found in 'Library' accessible in that project.
How would I do that?
On another note, this 'Library' project only exists because I want to use a number of classes of my own to supplement the the usual java libraries (java.util, java.io, etc...). Is there a way I can add my java project to my java libraries? (ie. 'import java.Library.className;')
Thanks,
Jonathan
Just have "Project" reference your "Library", on windows the process is (using menu / tab names)
- 1. Go to: Project -> Properties -> Java Build Path -> Projects
- 2. Client Add...
- 3. Select your "Library" project from the list
- 4. Click Ok
- 5. Click the other Ok
Now your done and you can use import for classes in your "Library"
这篇关于Eclipse - 导入您自己的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!