Results 1 to 5 of 5
  1. #1
    Jack2011 is offline Member
    Join Date
    Sep 2011
    Posts
    8
    Rep Power
    0

    Default How can I add properties file into eclipse classpath ?

    Hi,

    I am using a code from an open source project. This code is not well documented.

    There is a classpath problem but i am new in eclipse.

    This is the code :

    static {
    InputStream input = null;
    try {
    input = Thread.currentThread().getContextClassLoader().get ResourceAsStream("cmet-file.properties");
    _config.load(input);
    } catch (Exception ex) {
    System.err.println("Could not load properties. Be sure it's in classpath. " + ex.getMessage());


    This is the error "Could not load properties. Be sure it's in classpath"

    How can I add this file in the classpath ?


    I have attempted the following :

    1. Go to Java build path of the project
    2. Go to libraries tab
    3. Add external class folder
    4 . Choose the folder containing the properties file
    5. The problem is still there.


    How can I fix this problem ?


    Thanks

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default Re: How can I add properties file into eclipse classpath ?

    Hi Where is cmet-file.properties in your project?
    Skype: petrarsentev
    http://TrackStudio.com

  3. #3
    Jack2011 is offline Member
    Join Date
    Sep 2011
    Posts
    8
    Rep Power
    0

    Default Re: How can I add properties file into eclipse classpath ?

    Hi, it is in a build folder on the root of the project.

  4. #4
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default Re: How can I add properties file into eclipse classpath ?

    But It must be in a src folder. Like this
    /project/
    /project/src/
    /project/src/*.properties
    Skype: petrarsentev
    http://TrackStudio.com

  5. #5
    Jack2011 is offline Member
    Join Date
    Sep 2011
    Posts
    8
    Rep Power
    0

    Default Re: How can I add properties file into eclipse classpath ?

    Thanks but I added into /project/src/.
    It did not change anything.

Similar Threads

  1. Reading properties file
    By nn12 in forum New To Java
    Replies: 3
    Last Post: 09-13-2014, 12:48 PM
  2. checking runtime classpath in Eclipse
    By debu37 in forum Eclipse
    Replies: 3
    Last Post: 11-23-2012, 01:29 AM
  3. eclipse shiro classpath problem...
    By kievari in forum Eclipse
    Replies: 4
    Last Post: 09-28-2011, 12:25 PM
  4. Unable to access velocity.properties file from jar file
    By mjwoodford in forum New To Java
    Replies: 0
    Last Post: 10-09-2009, 01:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •