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

  • Home
  • SEARCH
  • 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 612603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:54:41+00:00 2026-05-13T17:54:41+00:00

Java successfully recognizes the path in my application.properties file when I have the path

  • 0

Java successfully recognizes the path in my application.properties file when I have the path configured as below:

pathToInputFile=/kcs/data/incoming/ready/
pathToInputFileProcess=/kcs/data/incoming/work/

If I try using an environment variable, the Java program doesn’t recognize the path.

(the environmental variable TOM_DATA is set as /kcs.)

pathToInputFile=${TOM_DATA}/data/incoming/ready/
pathToInputFileProcess=${TOM_DATA}/data/incoming/work/

Can I use an environment variable inside application.properties file?

  • 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-05-13T17:54:41+00:00Added an answer on May 13, 2026 at 5:54 pm

    You can put environment variables in your properties file, but Java will not automatically recognise them as environment variables and therefore will not resolve them.

    In order to do this you will have to parse the values and resolve any environment variables you find.

    You can get at environment variables from Java using various methods. For example: Map<String, String> env = System.getenv();

    There’s a basic tutorial here: http://java.sun.com/docs/books/tutorial/essential/environment/env.html

    Hope that’s of some help.

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

Sidebar

Related Questions

I have implemented JFileChooser of Java swing successfully. As the implemented JFileChooser gives file
Have anyone successfully managed to setup a combined Java/C++ project for Eclipse? What I
I have successfully connected my Oracle 11g XEdatabase with java in Netbeans 7.1. Class.forName(oracle.jdbc.OracleDriver);
I have used java mail(com.sun.mail.smtp) from my struts project. Mail is sent successfully but
I have successfully implemented this from android to a java httpservlet on google app
I am currently working on a Java EE project. I have successfully developed a
Hi I am using JRuby to interact with a Java class. I have successfully
I have successfully installed & configured the M2E Maven plugin for Eclipse, along with
I want to run the Java code below in Matlab. It ran successfully in
I have successfully installed Eclipse 3.5 and Java 1.5. I would like to install

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.