Java claims—and rightly so—to be a “compile once, run anywhere” language. But when a program starts, that “anywhere” is now a specific somewhere. When running a Java application on Linux, or any environment for that matter, the question arises, “Where am I?” (context, environment, familiar landmarks). What can a Java program find out about its environment? In particular, on the Linux platform, (how) can we get at:
The current shell’s environment variables?
The current working directory?
The location of data files?
The answers to these questions will depend on what kind of Java application you are creating, and just how portable you want your application to be.