Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Can't see lib folder within project(Can't add jar files to build path, refresh doesn't work)
Can't see lib folder within project [message #1712163] Wed, 21 October 2015 15:51 Go to next message
Ammon Allgaier is currently offline Ammon AllgaierFriend
Messages: 2
Registered: October 2015
Junior Member
I recently set up a new instance of Eclipse for Java EE on a Windows laptop, checked a bunch of projects out of CVS, and today I have to make a change on one of the projects for the first time.

In order to build the project, I need to add a bunch of jar files to the build path. The jar files are in a WEB-INF/lib directory within the project. Unfortunately, Eclipse won't show me that directory. I've tried to F5, right-click and refresh the project, refresh the entire workspace, delete the project and check it out again, all to no avail.

I understand that Eclipse will hide already-used libraries and folders, in order to make life easier when configuring the build path. But it won't even show that WEB-INF/lib folder in Package Explorer or Project Explorer or Navigator either.

Can somebody give me a hand? I've spent the last hour googling for a solution, with no results Sad
Re: Can't see lib folder within project [message #1712178 is a reply to message #1712163] Wed, 21 October 2015 18:49 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 10/21/2015 12:09 PM, Ammon Allgaier wrote:
> I recently set up a new instance of Eclipse for Java EE on a Windows
> laptop, checked a bunch of projects out of CVS, and today I have to make
> a change on one of the projects for the first time.
>
> In order to build the project, I need to add a bunch of jar files to the
> build path. The jar files are in a WEB-INF/lib directory within the
> project. Unfortunately, Eclipse won't show me that directory. I've
> tried to F5, right-click and refresh the project, refresh the entire
> workspace, delete the project and check it out again, all to no avail.
>
> I understand that Eclipse will hide already-used libraries and folders,
> in order to make life easier when configuring the build path. But it
> won't even show that WEB-INF/lib folder in Package Explorer or Project
> Explorer or Navigator either.
>
> Can somebody give me a hand? I've spent the last hour googling for a
> solution, with no results :(

This is really a question for the Eclipse WTO forum.

This said, when I've developed just such software--and not used Maven--I
put the JARs into a lib subdirectory under the project. Then I add them
using Build Path. At the same time as you add the JARs, you'll see an
option to add them to the Deployment Assembly which you must do so that
Eclipse will copy them there when you launch in Tomcat (say) or generate
your WAR file.

I hope this is helpful. If not, repost your question in the appropriate
forum.

Cheers
Re: Can't see lib folder within project [message #1712202 is a reply to message #1712178] Wed, 21 October 2015 21:56 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Eclipse Web Tools Platform (WTP). (I can't type today.)
Re: Can't see lib folder within project [message #1712287 is a reply to message #1712202] Thu, 22 October 2015 16:15 Go to previous messageGo to next message
Ammon Allgaier is currently offline Ammon AllgaierFriend
Messages: 2
Registered: October 2015
Junior Member
Well, I finally got it fixed. Here's what I did to eventually get it to work (some of these steps may be unnecessary, but I'm documenting them anyway):
--Copy the project folder to another location
--Delete the project and remove files from within Eclipse
--Create a new Java project in that directory
--Close Eclipse
--Copy the project folder back
--Delete any files starting with a "." (.classpath, .project, etc)
--Start Eclipse
--Reconfigure the build path (/lib folder appears! yay!)

In order to get it to attach back to CVS:
--open CVS repository exploring
--find the project in the repo
--Check out to...
--Existing project

Whew.
Re: Can't see lib folder within project [message #1712291 is a reply to message #1712287] Thu, 22 October 2015 16:42 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 10/22/2015 10:15 AM, Ammon Allgaier wrote:
> Well, I finally got it fixed. Here's what I did to eventually get it to
> work (some of these steps may be unnecessary, but I'm documenting them
> anyway):
> --Copy the project folder to another location
> --Delete the project and remove files from within Eclipse
> --Create a new Java project in that directory
> --Close Eclipse
> --Copy the project folder back
> --Delete any files starting with a "." (.classpath, .project, etc)
> --Start Eclipse
> --Reconfigure the build path (/lib folder appears! yay!)
>
> In order to get it to attach back to CVS:
> --open CVS repository exploring
> --find the project in the repo
> --Check out to...
> --Existing project
>
> Whew.

An alternative of which you may be unaware is not to put your source
code into the physical Eclipse filesystem workspace. Instead, try this
(assumes no project in Eclipse yet):

1) Create a new (Dynamic Web) project.
2) In the new project wizard, uncheck Use default location.
3) Click Browse... button and navigate in your filesystem to where you'd
like the project to live.
4) Finish specifying project particulars with the wizard.

I think most of us do not put our project source code into our
workspaces after the first few times we work in Eclipse (i.e.: while
we're learning it). I guess I could be wrong, but it's been many years
since I put other than a quick-try-this project in the default location.

I see Eclipse as a tool, like Vim, and less as the whole world I live
in. Besides, the greater filesystem organization of most professional
projects makes workspace collocation impossible or cumbersome.

Also, once you've set up a working project, and committed the files to
your version-control system (CVS in your case--no longer
enthusiastically supported by Eclipse by the way), you'll not be
creating new projects (let alone copying their contents into your
workspace), but importing them (File -> Import... -> General -> Existing
Projects into Workspace). Of course, on a new project, one person has to
create and set it up initially.

Hope this helps.
Re: Can't see lib folder within project [message #1714233 is a reply to message #1712291] Tue, 10 November 2015 22:39 Go to previous message
dani hamo is currently offline dani hamoFriend
Messages: 5
Registered: November 2015
Junior Member
I guesse you can see it in the project folder and add any think to project folder after that refresh project
Previous Topic:Debug a java program by executing "gradle run"
Next Topic:Noob question re: opening .jar files
Goto Forum:
  


Current Time: Tue Apr 23 17:48:36 GMT 2024

Powered by FUDForum. Page generated in 0.08244 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top