V
V
Vladislav Miasnykov2019-02-09 23:53:17
Java
Vladislav Miasnykov, 2019-02-09 23:53:17

Why can't the compiled program be run on another OS?

I watched a webinar on Java and it said that a program written in it can be transferred to another OS without recompilation and run.
But they didn’t really explain why it’s impossible, for example, to write and transfer in C ++. What is it connected with?
They also said that Java is a compiled-interpreted language. I'm confused, before that they said that Java is simply compiled. Please explain, I'm a total newbie.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
F
Fixid, 2019-02-09
@DarkCoffee

If it’s extremely figurative:
From Java they make a bytecode that doesn’t matter where it is executed and it runs inside a special JVM
From C ++ they make a binary that binds (links) to external libs and the system environment and runs directly in the system

S
Saboteur, 2019-02-10
@saboteur_kiev

Because the C++ program is executed directly in the operating system, and the java program is executed in the java machine.

J
jcmvbkbc, 2019-02-10
@jcmvbkbc

Why can't the compiled program be run on another OS?

Given that WINE and DOSBOX have been around for 300 years and the windows subsystem for linux did not appear yesterday, the question is, to put it mildly, strange. It can be launched if the "other OS" has support for compatibility with the OS for which the program was compiled.

V
Vitsliputsli, 2019-02-10
@Vitsliputsli

Different operating systems have different formats of executable files, because The OS must understand how to load and execute the file.
Java is as compiled as PHP, they are interpreted languages, but due to JIT compilation, they can probably be called compiled-interpreted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question