Chapter 4. Where Am I? Execution Context


Java claimsand rightly soto 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.



    Java Application Development with Linux
    Java Application Development on Linux
    ISBN: 013143697X
    EAN: 2147483647
    Year: 2004
    Pages: 292

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net