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 |
Ammon Allgaier 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
|
|
|
Re: Can't see lib folder within project [message #1712178 is a reply to message #1712163] |
Wed, 21 October 2015 18:49 |
|
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 #1712291 is a reply to message #1712287] |
Thu, 22 October 2015 16:42 |
|
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.
|
|
| |
Goto Forum:
Current Time: Tue Apr 23 17:48:36 GMT 2024
Powered by FUDForum. Page generated in 0.08244 seconds
|