Question

Is it possible to to make server/client code in C/C++/Java, that can be platform independent?

It should not require any additional package (like No JVM requirement) installation on system just the executable file to run (if possible on Windows/Linux/Mac).

If not could you tell me any other way (maybe language) to achieve this ? Thank You

Was it helpful?

Solution

just the executable file to run (if possible on Windows/Linux/Mac).

This can be done with Qt C++ by writing portable code and using static linking to bind the DLL's. A downside to this is that you will end up with a much larger executable file. Java uses the JVM which rules it out like you stated.

It should be noted that the platform you compile it for will be the only target the executable works on. So a program compiled on Windows won't work on Ubuntu (you will need to compile a seperate version for that - Unless you install the .exe in Wine perhaps).

OTHER TIPS

Simple answer: NO! (As noted: If you do not want to compile for each platform independently)

Either you need platform targeted code or need a middleware like JVM with Java Bytecode or .NET Framework with MSIL (Microsoft Intermediate Language). I guess node.js could be regarde as a middleware as well.

Since .NET Framework is not available in linux/mac I suggest using Java.

If you use static binding in C++ and Qt or whatever it is like adding the middleware to your binary. Still I suggest using an existing and wide spread middleware: Java.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top