-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

Mr. Alien
  • 153,751
  • 34
  • 298
  • 278
  • 3
    Your question is very unclear at the moment, I'm afraid. – Jon Skeet Feb 15 '14 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. – user3025161 Feb 15 '14 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. – Leo Feb 15 '14 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](http://www.winehq.org/). And running Linux executables on Windows requires you to install a Linux environment on Windows (something like [Cygwin](http://www.cygwin.com/)) - For Java you need to install a Java Runtime Environment everywhere. – zapl Feb 15 '14 at 12:07

1 Answers1

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

Community
  • 1
  • 1
Gary
  • 13,303
  • 18
  • 49
  • 71
  • Please elaborate your answer i am new in java . – user3025161 Feb 15 '14 at 12:01
  • 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. – Gary Feb 15 '14 at 12:05
  • 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) – Gary Feb 15 '14 at 12:07