So The questions are:The idea is simple: Java technology-based software can work just about everywhere. Java technology components don't care what kind of computer, phone, TV, or operating system they run on. They just work, on any kind of compatible device that supports the Java platform.
- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
When compiled, byte code is produced (this is not the same as executable code on your PC).
The Java Virtual Machine interprets the byte code and executes it on the target platform, thus the code you compile can be run on any platform with a JVM installed.
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
1). No, the byte code is not truly "executable." It must be interpreted by the JVM
2). Yes, the JVM must be present. The code does not take the JVM with it; it must be installed separatly. You can either have the person installing your program make sure that java is installed -OR- use an installation program (such as InstalAnywhere) to automatically detect if the JVM is installed and install it if not.
3). This is different from C++ in that C++ must be recompiled on every platform you want to run it on (but Java requires the JVM to be present, where a compiled C++ program is truly "stand-alone"). Using java, you compile your program once and then any JVM can run it (depending on version, of course...)
JVM
Consider Paul's rocket mass heater. |