I need that my code can get the environment variable when running test with IntelliJ:
private String sdkDir = System.getProperty("sdk.root");
The problem is that this is always null
, I have set both in bashrc
and also with bash_profile
but not really works with Ubuntu.
bashrc
and bash_profile
both have this:
export JAVA_HOME=/home/xybrek/zulu1.8.0_25-8.4.0.1-x86lx64
export JAVA_OPTIONS="-Dsdk.root=/home/xybrek/java-sdk-1.9.17"
export PATH=$PATH:/home/xybrek/zulu1.8.0_25-8.4.0.1-x86lx64/bin
export PATH
What could be missing with my configuration?
Update:
I cannot change the Java code: System.getProperty("sdk.root");
as this is coming from a compiled Arquillian container I can't modify.
What I need would be a proper way of having this System.getProperty
method to get the value.
Where to put this "sdk.root" for IntelliJ to pick it up? In a properties file or bash?