System Variable
Using java.lang.System, you would be able to access the system variable.
JDK 1.5
For JDK 1.5, use the following code snippet.
Code Snippet
java.lang.System.getenv(name)
Example :
Create a label with the field type set to 'Script' and type in the following :-
java.lang.System.getenv("temp");
JDK 1.4
For JDK 1.4, 'java.lang.System.getenv(name)' is not available as it is deprecated since JDK 1.3 but has been un-deprecated inJDK 1.5.
Steps to be taken :
- Set the variable and value at the console
- Access using the following codes.
Example :
When launching Elixir Report Professional, include the sentence (-DSample=Test) to the batch file.
Code Snippet
java -DSample=Test -jar ERD-Launcher.jar
Create a label with the field type set to 'Script' and type in the following :-
Code Snippet
java.lang.System.getProperty("Sample");
--
TanDunlin - 05 Jan 2006