Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Unable to add log4j to my eclipse project

  • 06-07-2010 7:48am
    #1
    Registered Users, Registered Users 2 Posts: 46


    Hi Guys,

    I am using Eclipse Helios as my IDE. I am trying to add the log4j zip file to my project.

    I am performing the following steps:

    - Create a new Java project
    - Right click on newly created project and select 'Build path -> Configure Build path...'
    - Select libraries tab
    - Select 'Add external JARs...'
    - Browse to log4j zip file and select
    - Zip file appears in the list of JARs and class folders on the build path
    - Create a simple class file in the SRC directory
    - Type "import org.pache.log4j.*;

    I am getting a cannot be resolved error message. I have only recently installed Helios but by following the steps above I was able to add libraries in older versions of eclipse.

    I dont think I am missing any thing simple. Any help would be great as I am pulling my hair out at the minute.

    Cheers.


Comments

  • Moderators, Sports Moderators, Regional Abroad Moderators Posts: 2,666 Mod ✭✭✭✭TrueDub


    happo wrote: »
    - Type "import org.pache.log4j.*;

    Is this a typo in your message? If not, it should be org.apache - not org.pache


  • Registered Users, Registered Users 2 Posts: 1,101 ✭✭✭Rulmeq


    happo wrote: »
    Hi Guys,

    - Zip file appears in the list of JARs and class folders on the build path

    Cheers.

    I'm pretty sure you need to extract it from the zip file before you can use it (and you need to fix the typo mentioned)

    Also if you are starting afresh, you should consider using logback instead of log4j: http://logback.qos.ch/reasonsToSwitch.html

    Also, look at using a dependency management/project management system like maven/ivy to make your life easier through convention over configuration.


  • Moderators, Sports Moderators, Regional Abroad Moderators Posts: 2,666 Mod ✭✭✭✭TrueDub


    Rulmeq wrote: »
    I'm pretty sure you need to extract it from the zip file before you can use it

    Not necessarily - it depends if the zip contains a jar, or a file structure. If it contains a jar, then extract it. If not, just put in the zip.


Advertisement