Just curious to know when java is made platform independent then are there any specific reasons JVM is made platform dependent..
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Because there needs to be some way to convert the platform-independent application's Java calls to calls that are compatible with the underlying OS.
JVM is platform dependent because it takes java byte code and generates byte code for the current operating system. So Java software is platform dependent but Java language is platform independent because different operating system have different JVMs.
I think that it could be platform independent if many different languages (each one written in specific different platform )where combined to make it change its own code dynamically.But all these take some great effort to happen and maybe destroy its portability.
Unless you have a CPU that can directly execute Java bytecode (there are such things) you need to be able to interact with the OS (for things like reading files, connecting to the network, displaying to the screen, etc...).
You can write a JVM in other languages (such as Java or JavaScript) but ultimately there needs to be something that can interact with the underlying OS.
I found that this was a great answer to the question:
Quoted from Is the JVM Platform Dependent?
No, JVMs are not platform independent. In fact they are platform specific run time environment provided by the vendor. Each platform (Windows, UNIX, Mac etc) has its own JVM to run Java applications. Although the byte code supports connection to multiple databases..
Think of Music being played in a MP3 player, CD player and old faithful cassette players(Boom Box). The output is always the same, ie music. But the input (media ie .mp3 files for MP3 Players, CDs for CD Players and cassettes for Cassette Players) vary depending on the system [here the systems will be the various Operating Systems like Windows, UNIX, Mac etc..]. Hope i was able to solve your problem..