7

I have a properties file that needs to be loaded into a java program. Part of the path is defined by the system environment variable JAVA_TOP. When i give the full path it recognizes the file. Otherwise it won't. I tried giving file path as:

<JAVA_TOP>/abc.... 
$JAVA_TOP/abc...
JAVA_TOP/abc

None of them seem to work. Please let me know how to read the environment variable JAVA_TOP from the java application.

1 Answer 1

13

I am assuming, you are looking at reading the environment variable JAVA_TOP in your Java code. System.getenv("JAVA_TOP") should return the value of JAVA_TOP

Sign up to request clarification or add additional context in comments.

1 Comment

indeed this is what i want. Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.