简体   繁体   中英

Importing source code of a library in Eclipse

I have a question about importing .java files.

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.

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;

How can I fix this problem? Using CTRL + SHIFT + O does not fix it.

You can use Eclipse File System Import to import sources to a particular project. Here is a step by step explanation.

Another example . Scroll down to "Importing Files Into a Project" section

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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