Eclipse - 导入您自己的库 [英] Eclipse - Importing your own library

查看:86
本文介绍了Eclipse - 导入您自己的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个独立的java项目,图书馆和项目,我在项目中有一个类'想要实现'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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆