platform-independence

How does program execute? Where does the Operating Systems come into play?

青春壹個敷衍的年華 提交于 2019-12-20 08:07:40
问题 A program is compiled from some language to ASM --> Machine Code (directly executable). When people say that this is platform dependent, the mean that the binaries formed will run (correctly) only on the CPUs with same Instruction Set Architecture like x86, x86-64. It may (incorrectly) / may not (at all) run on other processes because of the difference in ISA. Right? Now, the concept of binaries is confusing me. Everything is about the "Machine Language Code" & "CPU". Where does the OS come

Passing environment variables to a JVM, in a platform-independent manner

最后都变了- 提交于 2019-12-18 12:54:08
问题 I'm developing a J2EE application that runs in JBoss on a Windows Vista machine, but the application will end up on a Linux machine. Is there a way to pass in the value of an environment variable in a platform independent way? I think (but I'm not sure) the platform-sensitive way would be: -Denv_var=%MY_ENV_VAR% (Windows) -Denv_var=$MY_ENV_VAR (Linux) and from there I would access the value (in Java) using System.getProperty("MY_ENV_VAR"); — is that correct? The Javadoc for System.getenv

Can I find out what variable java.library.path maps to on the current platform?

安稳与你 提交于 2019-12-18 03:03:38
问题 So far I've learned the following about the java.library.path property: It's used when loading native libraries, as opposed to java classes Its default value depends on the operating system: On Windows, it maps to PATH On Linux, it maps to LD_LIBRARY_PATH On OS X, it maps to DYLD_LIBRARY_PATH (Please correct me if I've misunderstood any of the above) My motivation: I want to modify the value of java.library.path seen by a Java application from the framework I've set up to invoke the Java