I have a property TOOLS_DIR that i exported in bash
I have the following line in my java file:
String toolsDir = System.getProperty("TOOLS_DIR");
Why is this returning null? is the a compatibility issue with linux or something?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Environment variables and properties aren’t the same thing. If you want to pass in an environment variable as property you have to add the following to your java invocation:
Alternatively, you can use
System.getEnv()