O'Reilly logo

Java™ Application Development on Linux® by Michael Schwarz, Carl Albing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Where Am I? Execution Context

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:

  • Command-line parameters?

  • 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.

What You Will Learn

We’ll ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required