A
A
Anton Akimov2016-12-20 21:38:57
Java
Anton Akimov, 2016-12-20 21:38:57

Why is "cross-platform" needed in Java?

A few reasons why it is not needed:
1) using a regular compiled language like C++, you can check the current execution environment in the code and, depending on it, use certain variables or functions (yes, this is some kind of hassle, but this realizable);
2) when there is a need to refer to specific API functions (and it arises), part of the code in a "cross-platform" application still has to be made platform-dependent;
3) Java does not solve problems with different display of UI elements on different systems right off the bat (there is still a lot of fuss with this);
4) to run a Java application, Java must be installed on the user's system,
5) in order not to fool the user with incomprehensible jars, you have to create a launcher for a specific software / hardware
environment this garden with virtual machines and swing'om.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
R
roswell, 2016-12-20
@antaki93

1) only C / C ++ software will have to be compiled for all target platforms;
2) platform-dependent parts of the code in most cases are already assembled into libraries;
3) JavaFX or native implementation of Swing UI. Even a naked Swing can be combed so that it looks almost the same on all platforms, it will not be difficult;
4) the same with .net (the fact that Microsoft pushes its runtime to Windows is not the merit of dotnet as such. And at the same time, ask how dotnet is doing with API stability);
5) there is no fuss with jars, it is enough to install JRE.
In general, you just don't know how to cook cats^W coffee o)

S
Sergey Gornostaev, 2016-12-21
@sergey-gornostaev

9f3ceb8416dd42c686f2a251193bdbc7.png

O
OnYourLips, 2016-12-20
@OnYourLips

Good cross-platform is just a nice little bonus when using a virtual machine. Not a target.
You need to understand that some technology stacks are great for some tasks and bad for others. No need to write application software in Java for ordinary users.

E
Eugene, 2016-12-21
@zolt85

It seems to me that the founding fathers meant by cross-platform something more low-level than the operating system. Processor architectures, for example, or file systems, etc. So the JVM allows you not to worry about these things. Code written and compiled once runs everywhere (where there is a JVM). These are all of course general cases and there are examples where this does not work. Same Android. You can't run Android apps on your MacBook, for example. But that's a completely different story...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question