facebook

WEB-INF/lib can’t add jars from ide

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #285493 Reply

    douglasv
    Member

    can’t add jars to WEB-INF/lib

    in the win xp file navigator I added 4 jars to the WEB-INF/lib
    folder but I can’t see them in the project explorer
    under WEB-INF/lib
    but they do show up under referenced libraries in project explorer

    Many articles say if the jars, drivers etc don’t work from the build
    path or other locations , to put them directly in the WEB-INF/lib
    to be shure there present at run time

    Nor can I add anything directly to WEB-INF/lib from the project explorer

    Is there something like a project file view

    What should I be doing?

    Thank you,
    Douglasv

    #285498 Reply

    Loyal Water
    Member

    Did you try refreshing the project in your Project Explorer ?

    Are you able to see the jar files under the lib folder in the Package Explorer?

    #285500 Reply

    douglasv
    Member

    @support-nipun wrote:

    Did you try refreshing the project in your Project Explorer ?

    Are you able to see the jar files under the lib folder in the Package Explorer?

    No, I can’t see the files under the WEB-INF/lib folder
    nor can I put any there, the have to be entered outside of the ide
    and they are shown in the ide as “Referenced Libraries”

    Also: under WEB-INF/ You can’t see a classes folder , if you try to create one
    it already exists message appears, Ii’m sure the ide has a format which precludes me
    from making a WEB-INF/classes/product folder, Wanted to protect code from showing

    #285536 Reply

    Loyal Water
    Member

    I tried adding jars to the WEB-INF folder outside the IDE and I could see the jars when I refreshed the project in the Project Explorer.

    Seems ,like your workspace might be corrupt. Can you switch to a new workspace, create a new web project and try this again. Also, can you try dragging and dropping jars in to the WEB-INF folder. Do the jars show up now ?

    #285703 Reply

    douglasv
    Member

    @support-nipun wrote:

    I tried adding jars to the WEB-INF folder outside the IDE and I could see the jars when I refreshed the project in the Project Explorer.

    Seems ,like your workspace might be corrupt. Can you switch to a new workspace, create a new web project and try this again. Also, can you try dragging and dropping jars in to the WEB-INF folder. Do the jars show up now ?

    I haven’t been able to do One Thing with Myeclipse!!!

    I have removed it from my computer.
    We may have a Full Blown Scam on our Hands!!!

    #285709 Reply

    rakehell
    Member

    I’m having pretty much the same problem. I imported a jar into a Java project and now I’m struggling with getting it to be “seen” by the IDE. I added it to my build path via “Add Class Folder” because that was the only option that would work. Except that it doesn’t. It’s still showing an error in the class where I’m importing from that jar – import can’t be resolved.

    No offense, Nipun, but this is a very simple, common thing to do and that fact that it’s difficult and/or counter-intuitive does not speak well of this IDE. I have tried F5 as well as “Refresh” from the menu dropdowns. Nothing seems to work. What a piece of junki!!!

    #285710 Reply

    rakehell
    Member

    One more thing:
    I can see the class I’m referencing in the Package Explorer. After I used “Add Class Folder”, it appeared as a “Referenced Library”.

    I searched the “Help” in MyEclipse, which was no help at all. It just repeats what the wizard says. The “Import a Jar” help page does not reference the most logical next step, “Adding the jar to your CLASSPATH”. Seriously, what’s the point of “importing a jar” if you can’t “add it to your classpath”? It also erroneously states that when you select “Add Library” that you can browse to the library. However, that’s incorrect. There is no “Browse” button.

    #285726 Reply

    Riyad Kalla
    Member

    Douglas,
    Let me clarify, what you are seeing is the *correct* behavior of MyEclipse and has been the default behavior for quite a while now. To recap:

      * When you add a JAR to your /lib directory and the IDE detects the JAR (either by you manually refreshing or by it refreshing the project contents itself), it will automatically add that JAR to the Build Path of your project. The Package Explorer view will show this by *hiding* the JAR from the /lib directory and added ti under “Referenced Libraries” node. If you want to see the literal project layout, you can switch to the Navigator view to see it. There you see everything laid out *literally* as it is in the file system. In both the Package and Project views you see a translated “logical” view of your project.
      * Output folder: Again, from either of the logical views (Package or Project) your output folders are *always* hidden so you cannot get into the habit of editing their contents directly because each time the project is rebuild, those contents are completely erased and rebuilt/re-generated.
      * Lastly, yes you can drag and drop JAR files into your WEB-INF/lib directory and the IDE will automatically add them to your build path. You can do that from either the Package, Project or Navigator view and MyEclipse will see the new files and add them.
    #285727 Reply

    Riyad Kalla
    Member

    rakehell,

    Adding a “Class Folder” cannot be used to add a JAR as you are finding out. Clicking the “Add JAR” button means you are adding a JAR from inside the workspace, if you are trying to point to a JAR elsewhere on your hard drive, click Add External JAR. ANd lastly, if you are trying to *add* a JAR to your project, you can drag and drop it into the WEB-INF/lib directory and MyEclipse will add it automatically to the build path.

    You do all this from your project properties page, under Java Build Path > Libraries tab, you don’t use the File > Import wizards (incase you were trying to); that’s an unrelated operation.

    I hope that helps.

    #285746 Reply

    rakehell
    Member

    Hi Riyad,
    I appreciate your response but actually no, it doesn’t help. First, this is a Java Project, not a web project, so there’s no WEB-INF directory. The first thing I tried was Java Build Path->Libraries, however, the only option that appeared close was “User Libraries”. But, I don’t have the file it’s looking for, .userlibrary. I am not trying to “point to” an External Jar, which is what happens when I use “Add External Jar”.

    I want to copy a jar into my project and have it included in the build path. Why is this so hard? Am I missing something?

    #285747 Reply

    rakehell
    Member

    Hi Riyad,
    I appreciate your response but actually no, it doesn’t help. First, this is a Java Project, not a web project, so there’s no WEB-INF directory. The first thing I tried was Java Build Path->Libraries, however, the only option that appeared close was “User Libraries”. But, I don’t have the file it’s looking for, .userlibrary. I am not trying to “point to” an External Jar, which is what happens when I use “Add External Jar”.

    I want to copy a jar into my project and have it included in the build path. Why is this so hard? Am I missing something?

    #285813 Reply

    Riyad Kalla
    Member

    I want to copy a jar into my project and have it included in the build path. Why is this so hard? Am I missing something?

    Oh, even easier. Drop the JAR into your project, folks normally like to create a /lib dir and put them there, then right-click it and go to Build Path > Add to Build Path, done.

    I think you are just thinking about these operations the wrong way and thus making this a whole lot more painful of a process than it really is. None of these operations will copy a JAR or library into your project, you have to do that. So once you have done that, you can add them to your build path using the method above, or using Add JAR. If you want to setup a User Library you can, but probably not necessary in this case.

    #285876 Reply

    rakehell
    Member

    Well the reason I’m thinking this way is because it’s pretty difficult to find any documentation that says what you just said. So, most people are going to do what’s intuitive, hoping that it’s The Right Way. Here’s a really wild idea: Why don’t you take this really simple task and DOCUMENT IT instead of transmitting it via folklore?

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: WEB-INF/lib can’t add jars from ide

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in