Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDeveloper: unable to locate properties file

LeylaDahApr 10 2013 — edited Apr 10 2013
Hello Experts,

I'm working with JDeveloper11R1, and I need to load some information from a properties file.
I copied the file config.properties both on the WEB-INF directory and in the com/project/ directory, but when trying to load with a class positioned also in the com/project directory..
        Properties prop = new Properties();
        try {
            prop.load(new FileInputStream("config.properties"));
OR
            prop.load(new FileInputStream("/config.properties"));
OR
            prop.load(new FileInputStream("/com/project/config.properties"));
OR
            prop.load(new FileInputStream("/WEB-INF/config.properties"));
I all the above situations I get the file not found error:

java.io.FileNotFoundException: /com/project/config.properties (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at com.project.Loader.<init>(Loader.java:35)
at com.project.Loader.main(Loader.java:133)
Process exited with exit code 0.

I guess that I should configure the Classpath in JDeveloper, but also loading the Directory from "Project Properties - Library/Classpath" it doesn't work.

Could you please help?

Thank you
This post has been answered by Timo Hahn on Apr 10 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 8 2013
Added on Apr 10 2013
3 comments
1,434 views