简体   繁体   English

在Eclipse中导入库的源代码

[英]Importing source code of a library in Eclipse

I have a question about importing .java files. 我有一个关于导入.java文件的问题。

I have downloaded source codes of a library that has many subfolders. 我已经下载了包含许多子文件夹的库的源代码。

The way that I imported is to create a new folder within my project called libs and dragging dropping the entire folder, after that I right clicked into the libs folder and then clicked Build Path-> Use as Source Folder. 导入的方法是在项目中创建一个名为libs的新文件夹,然后拖放整个文件夹,然后右键单击libs文件夹,然后单击“构建路径”->“用作源文件夹”。

Now the issue is most package names are like "analysis.common.src.java.org.apache.lucene.analysis.ar" whereas within their source code their package name is referred as package org.apache.lucene.analysis.ar; 现在的问题是,大多数软件包名称都类似于“ analysis.common.src.java.org.apache.lucene.analysis.ar”,而其源代码中的软件包名称则称为org.apache.lucene.analysis.ar软件包;

How can I fix this problem? 我该如何解决这个问题? Using CTRL + SHIFT + O does not fix it. 使用CTRL + SHIFT + O不能修复它。

You can use Eclipse File System Import to import sources to a particular project. 您可以使用Eclipse File System Import将源导入到特定项目。 Here is a step by step explanation. 是分步说明。

Another example . 再举一个例子 Scroll down to "Importing Files Into a Project" section 向下滚动到"Importing Files Into a Project"部分

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM