开发者

How do I get the "referenced libraries" folder back In the eclipse sdk?

I use the eclipse Ganymede sdk for developing Java apps. I'm having a strange Issue.

Everything was working fine until recently where the "referenced Libraries " folder went missing from the explorer.

I used to upload the jar's I need Into the workspace. I uploaded the jars In a folder named "lib" and after refreshing the project folder In eclipse that folder "lib" containing the Jar appears. Now,the Issue arises,when I right click on the jar and select "add to path" the jar Instead of appearing In the "referenced libraries" folder just disappears. Note:the referenced Library was never there In the first place,I need to find a way to get the folder back.

here's a snapshot of my eclipse framework : http://www.flickr.com/photos/38561743@N0开发者_开发百科3/4122304046/sizes/o/


The root - Referenced Libraries - of the lib jar disappear if you open J2EE perspective, leaving all the jar in the main project root folder. This is very annoying so, Please change e perspective from J2EE to Java.


Did you uncheck the Show 'Referenced Libraries' Node (accessible through the menu for Package Explorer: the small triangle in the explorer’s title bar)?

(EDIT: The OP provided a screen shot showing that Show 'Referenced Libraries' Node is checked in comment to this answer. He confirmed that libraries are not filtered too in a comment to another answer. So, actually, I don't know what is happening here. Strangely, I can't see the "JRE System Library" neither and this seems weird. So something must be wrong indeed, but I don't know what. This is not really a good solution but if you can't solve it, maybe consider reinstalling Eclipse.)


Usually JavaEE is the default perspective. Change it to Java perspective from

Window -> Open Perspective -> Java

This should solve the problem.

You can make Java as the default perspective

Window -> Preferences -> General -> Perspectives

So next time when you open another workspace, Java will be the default perspective and you won't be surprised that the Referenced Libraries has disappeared.


Please post the contents of your .project and more importantly of the .classpath files. They're located in the root of your project, but hidden. Use either Windows Explorer or the Eclipse Navigator view to see them.

The .classpath should contain an entry like the following:

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

For libraries, the .claspath file should contain entries like this:

<classpathentry kind="lib" path="lib/somelib.jar"/>


Same issue I had where Reference library does not appear. Close the package explorer and reopen again , it worked.


This is simple:

Firstly make sure that Show 'Referenced Libraries' Node is checked. This can be found by clicking the down arrow in the Package Explorer.

Then, what you probably want to do is ensure all the dependent libraries are in the classpath. If its a Maven project simply right-click the project, Properties, then under the Libraries tab 'Add variable'. Then navigate (and select) to one of the dependencies using the M2_REPO variable.

You should see the Referenced Libraries come up. All you have to do from here is make sure each classpath entry (type "var") you need is present in the .classpath file.


Even if you are in the Java perspective and opened your project in project explorer view you wouldn't get what you need. you need to be in the package explorer view to get the Referenced Libraries.

Window --> Show View --> Package Explorer


Sounds like you've accidentally enabled a filter on the explorer view. Bring up the "view menu" item (the downward-pointing arrow at the top right of the explorer pane), pick "filters", and make sure "libraries from external" and/or "libraries from project" is not selected.


I have a hunch that this is because the lib folder is actually empty and there is nothing aded to classpath yet.

This is how you can be sure 1. In package explorer, select "lib" folder and press F5 (refresh). If it doesn't gets the + sign in front of it, the folder is empty. 2. Right click on "lib" and select "Go Into". If the package explorer gets empty, the folder is empty. Select the back arrow icon from the package explorer view menu to get back. 3. Select "lib" menu and do press "Alt + Enter". You should see a properties dialog. Note the path in front of "Location". Copy it and open this location is windows explorer. You can verify that its actually empty or not.

You will see referenced libraries only when a jar has been added to the build path (I guess you know this already).

Try adding a dummy jar to build patch to see if referenced libraries shows up. You may use the "Add external jar" button on the "Libraries" tab of the "Java Build Patch" dialog for quickly verifying this.


you need change to Package Explorer and check 'show "referenced Libraried" Node'


Change perspective to Java perspective by following below instructions:

Follow this : Window -> Open Perspective -> Java

This should solve the problem and put all the Jars back to Referenced Libraries.


I believe you are using Project Explorer rather than Package Explorer. To fix the issue: Window->Show View-> Package Explorer or Alt_Shift+Q,P. See if that fixes your problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜