Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:42:32+00:00 2026-06-07T05:42:32+00:00

I have placed a properties file in below location. i created a folder in

  • 0

I have placed a properties file in below location. i created a folder in root and placed a properties file there.

/someFolder/some.properties

Now through java i need read properties using Properties class. can i give path as below?

Properties props = new Properties();

props.load(new FileInputStream("/someFolder/some.properties")); OR

props.load(new FileInputStream(“/someFolder//some.properties”));

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:42:33+00:00Added an answer on June 7, 2026 at 5:42 am

    Yes, you can give the path as in the first example and the second example will also work though there is no requirement for the //. You may has seen paths using \\, as the \ character requires escaping in string literals but the / does not require escaping.

    Instead of hard-coding the path into the code, consider specifying the path via a property (or some other configuration setting):

    java -Dmy.property.file=/someFolder/some.properties com.mine.MyApplication

    Then access the path via System.getProperty("my.property.file");.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a Java application that loads some configurations from a file conf.properties
I have placed translation file app_fi.properties in folder /WEB-INF/i18n/, but I get following error
enter code here I have a property file placed in the etc folder. myapplication.properties
I have some *.hbm.xml files that are placed in the same folder at the
I have this code in a Java EE Application for reading the Properties file.
I have multiple Node applications (build on Express framework). Now I have placed them
Assuming I have a .properties file and hibernate.cfg.xml in a standard maven web application
I wanted to know can we have images as a values in properties file
Currently i have placed the Displaytag.properties in 'src' directory, and it is working fine.
I have developed Java desktop application using Netbeans. In my application, I used some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.