[英]In scala eclipse how do I use a library in my workspace
This should be super easy. 这应该超级容易。 I'm using Scala IDE 3.0.4 of Eclipse.
我正在使用Eclipse的Scala IDE 3.0.4。
I have 我有
Workspace 工作空间
Common/src/Common/*.scala Common / src / Common / *。scala
MyProject/src/(default package)/foo.scala MyProject / src /(默认包)/foo.scala
How do I get MyProject to use my Common library code? 如何让MyProject使用我的公共库代码?
In MyProject foo.scala I import Common.Common (my package object) In MyProject properties, I've added a Project Reference. 在MyProject foo.scala中,我导入Common.Common(我的包对象)。在MyProject属性中,我添加了一个Project Reference。 I've also tried 12 ways of adding it to the java build path.
我还尝试了12种将其添加到Java构建路径的方法。
What did I miss? 我错过了什么?
Thanks much 非常感谢
You don't indicate what the 12 ways you've tried are, but I think the following should work, assuming Common
is another project in your workspace: 您没有说明尝试过的12种方法是什么,但是我认为下面的方法应该起作用,假设
Common
是工作空间中的另一个项目:
Common
project and MyProject
project are both open. Common
项目和MyProject
项目都已打开。 MyProject
-> Build Path
-> Configure Build Path
. MyProject
> Build Path
-> Configure Build Path
。 That should open a dialog. Projects
tab Projects
选项卡 Add
button - it should bring up another dialog where you can check the Common
project. Add
按钮-它会弹出另一个对话框,您可以在其中检查Common
项目。 Thereafter it should appear in the list under the Projects
tab. Projects
选项卡下的列表中。 Later, whenever you open the MyProject
project the Common
project will automatically be opened as well. 以后,每当您打开
MyProject
项目时, Common
项目也将自动打开。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.