Results 1 to 6 of 6

Thread: Eclipse and File Properties

  1. #1
    Join Date
    Dec 2009
    Posts
    204

    Eclipse and File Properties

    Hello,
    Here is my problem, I encode two classes in java, which I serve to read. With the properties, No pb, I can read a file.properties as I am not in eclipse. But I use eclipse, it sends a message that it can not find the file.properties while he is in the same folder where the two classes. Hope you guys will help me with the problem. Thanks in advance.

  2. #2
    Join Date
    Dec 2009
    Posts
    211

    Re: Eclipse and File Properties

    Hello,
    I have a similar kind of a problem with eclipse and the properties file. My tree is very simple. There is one package and all my classes are inside. To access the properties, I have defined getters. But if I go under my workspace and my package through a shell and that I run. Class, no pb to read. Properties gets all my values. That's when I'm in eclipse and I compile it to work more. But for my other projects without. Properties all compiles and runs. This is not a path bp. So, if any one has a solution for this then it would be great. Thanks for your help.

  3. #3
    Join Date
    Nov 2009
    Posts
    347

    Re: Eclipse and File Properties

    Hello,
    Because I think that goes right to the filename which you have mentioned in the Eclipse IDE. Properties instead of the road. What I think is that if this file is the same place as the two classes that are in the package my_package, then you must access it through "my_package / example.properties" and not by "example.properties" shortcut file. I hope you are getting the point what I am trying to explain here.

  4. #4
    Join Date
    Dec 2009
    Posts
    204

    Re: Eclipse and File Properties

    Hello,
    Thanks for your replies, but no, none of the solutions proposed is not working. I actually put the file in the root of the project, I also indicated the path. Nothing at all. My path of the file is as follows
    Code:
    workspace / MyProject / my_package / my-src.
    In my src is my Properties files. I have a package. Yet when I go out of eclipse, everything works perfectly, but the properties file have a problem, I do not know what exactly is the problem with the properties file.

  5. #5
    Join Date
    Nov 2009
    Posts
    333

    Re: Eclipse and File Properties

    Hello,
    It will not always know exactly how you can access your files? You showed us several types of access but it is unclear what lies behind. Furthermore we do not know your tree if it works. Finally the error message could be useful to use for debugging. But now you just show us the code using a class (Access) which we know nothing about. I do not see how you could help with so little info. Any information on this is need to give you a exact solution for your problem.

  6. #6
    Join Date
    Nov 2009
    Posts
    518

    Re: Eclipse and File Properties

    Hello,
    I might suggest you put an absolute path to your properties file, but it's not clean and you can not move your project. If your file is in your src if you tell him "my_package / mes_src / some.properties" is usually good. And also I more suggestion, do not use backslashes for file paths. Whether you bristle under Linux or Windows, use the simple slashes or method file.separator () for separators. Try with my_package / src / some.properties. Hope the tips will help you with your problem.

Similar Threads

  1. Eclipse not compiling my Java file
    By Valliy in forum Software Development
    Replies: 4
    Last Post: 25-07-2010, 12:30 AM
  2. Reading properties of a file
    By TechGate in forum Software Development
    Replies: 5
    Last Post: 14-02-2010, 05:46 AM
  3. Properties of .ini file
    By Logan 2 in forum Software Development
    Replies: 5
    Last Post: 25-01-2010, 01:43 PM
  4. how to browse ftp file in eclipse
    By Ashton5 in forum Technology & Internet
    Replies: 3
    Last Post: 17-06-2009, 04:58 PM
  5. C#.net how to access properties of a file?
    By Henrietta in forum Software Development
    Replies: 1
    Last Post: 11-08-2008, 01:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,896,138.01136 seconds with 17 queries