Eclipse does not show lib directory during Java Build Path -> Libraries editing

12,172

Solution 1

After you copy a jar file to your lib folder, you need to refresh the project in Eclipse (use F5) so Eclipse knows about it.

It will then show you the lib folder in that dialog.

Note: You are correct in your answer that the said dialog doesn't reread the directory structure, but you are missing the point - it is not supposed to. That's what you have "add external jar" for. Further more, Eclipse is trying to be smart and not show you jars that you have already added (think about a folder with 50 jars and you just want to add one). That's why it didn't show you the lib folder - it thought the folder was empty.

Solution 2

This is to help others. I had to do File -> Refresh to get Eclipse to see the files. Apparently file picker dialogs do not reread the disk structure. I guess they are pulling from Eclipse's main file directory image which has to be refreshed before new files are visible anywhere else in the program.

Solution 3

This is how I resolved this problem. I created a lib folder in my java project.Then I added some jar to lib folder.

enter image description here

But it doesn't appear in my eclipse IDE.Then I selected my project and right clicked on it. Then refreshed.

enter image description here

It works for me. I think this will help you.

Share:
12,172
Robert Oschler
Author by

Robert Oschler

Newly minted, avid Windows Phone developer with a passion for natural language processing apps that leverage Azure for a complete, intelligent, mobile client platofrm. Also a devout robotics enthusiast and consumer EEG headset applicaitons developer (Emotiv EPOC headset).

Updated on July 02, 2022

Comments

  • Robert Oschler
    Robert Oschler almost 2 years

    I have an Eclipse/Java project (Eclipse 3.5.2) that I am trying to add some JARs to. In the root project directory I have 3 sub-directories, src, bin, and lib and all 3 sub-directories are present in the Package Explorer list. I put the needed JARs into lib. However, when I go to Project Propertes -> Java Build Path -> Libraries (tab) -> Add JARs, and the file dialog comes up, it only shows the src and bin directories in the file picker, not the lib directory. I'm guessing it is something really simple, but can someone tell me why the file picker dialog doesn't show the lib directory?

    -- roschler