-6

Problem: I can not understand the meaning of the question and another doubt which is generated from the above problem is that all the java software which i am using are come with executable setup so i am little bit confused from this.

Thank You

4
  • 3
    Your question is very unclear at the moment, I'm afraid. Commented Feb 15, 2014 at 11:51
  • 1
    Why java does not support the concept of '.exe' file? This is question is in my text book. Can you please answer it. Commented Feb 15, 2014 at 11:59
  • Well, basically a java program is a bunch of bytecodes to be interpreted by a java interpreter. In theory, you could create an exe file with a jre embedded. Commented Feb 15, 2014 at 12:03
  • .exe works with the "Windows Runtime Environment" that is part of every Windows. It does not work e.g. on Linux unless you install a Windows environment like Wine. And running Linux executables on Windows requires you to install a Linux environment on Windows (something like Cygwin) - For Java you need to install a Java Runtime Environment everywhere. Commented Feb 15, 2014 at 12:07

1 Answer 1

2

Because exe's have to be compiled for specific environments.

Oracle compiles their runtime (JRE) for different operating systems, which interprets your Java file anywhere that has a JRE installed. You can however make an installer for it:

Create Windows Installer for Java Programs

Sign up to request clarification or add additional context in comments.

3 Comments

Please elaborate your answer i am new in java .
When you compile a language like C++, the compiler "translate" into lower level machine code, which limits where you can run that program. If you want to run it in an incompatible OS, for example, you'd have to compile it separately. Java does that work for you: They've compiled their "runtime environment" for different platforms so you only focus on getting your program to work.
As far as the "exes" your other applications run in, say for example "Open Office", that exe is just a packaged installer for setting it all up (making sure the files are put in the right place, the user has JRE, etc)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.