Portability Question !


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Portability Question !

  1. #1
    eejay Guest

    Portability Question !


    Visual C++ gave the ability to compile and link my code to an .exe that I
    could put on a floppy a take to a friends house and run. Is this possible
    with Java?

    Thanks in advance,

    eejay

  2. #2
    Ako Guest

    Re: Portability Question !


    "eejay" <enickols@midsouth.rr.com> wrote:
    >
    >Visual C++ gave the ability to compile and link my code to an .exe that

    I
    >could put on a floppy a take to a friends house and run. Is this possible
    >with Java?
    >
    >Thanks in advance,
    >
    >eejay


    Yes and no, the reason for this is C++ and Java have different philosophies.
    You will not be able to produce an executable file from java classes using
    JDK or even IDEs, but there is a tool called J2EXE which does exactly this
    for you.
    The reason you cant make a .exe file from java as easily as with C++ is C++
    compilers produce executable code which can run directly on hardware (ah
    you might say what a brilliant idea! but this severely limits the cross-platform
    portability, i.e. a program written and complied on a windows platform will
    not run on a Unix box). On the other hand Java is meant to be a platform
    independent and to achieve this a java complier produces a bytecode file
    from the compiled file instead of and executable file. Then this bytecode
    can be interpreted on any platform and give you the same result (at least
    in theory).

    Ako



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center