#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Riverside, CA
    Posts
    63
    Rep Power
    14

    Question about Java


    I know this isn't a java forum, but maybe someone can answer this question. I have made a simple java program and I have made a class file for it already. I want to know can I make an executable out of the program? If yes, how do I do that?

    Thanks,
    Jonathan Donaghe
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2000
    Posts
    763
    Rep Power
    0
  4. #3
  5. Mobbing Gangster
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Sep 2001
    Location
    "Best City" 2002 and 2003- Melbourne, Australia
    Posts
    4,912
    Rep Power
    33
    I can relate to that problem all right :D since I have started diging into java myself. Okie, some time ago I did a search and here is first link that poped up. Haven't tested yet, but sounds good.
    And you know I mean that.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    USA
    Posts
    12
    Rep Power
    0

    Lightbulb


    Hi,
    Go in for JIT(Just in Time Compiler). It will convert the bytecode or the .java code(dunno which) directly into a platform dependent executable. You should find the requisite material at java.sun.com.


    DA
    :cool:
  8. #5
  9. Mobbing Gangster
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Sep 2001
    Location
    "Best City" 2002 and 2003- Melbourne, Australia
    Posts
    4,912
    Rep Power
    33
    .java is the source .class is the bytecode, and correct me if I'm wrong but aren't jits only for freebsd and linux/solaris?
    And you know I mean that.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    Canada
    Posts
    33
    Rep Power
    14
    the GCC (GNU Compiler Collection) includes a java compiler, although I have never used it, so i can't comment on how good it is. Check it out here:
    http://gcc.gnu.org/java/

    and the regular GCC page is:
    http://gcc.gnu.org/

    GCC is a Linux/Unix thing, although I think you can get it for windows now (not sure).

    Good Luck
    X___________
    the PhatBarren
  12. #7
  13. SwollenMember
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    the master control
    Posts
    264
    Rep Power
    15
    i spent a whole day trying to figure this question out. there are a few utilities by 3rd party vendors that will allow you do make it an .exe file, but i would be a little hesitant to do this. it sounds like you might be marketing (selling) your program and you want it to be able to run without the Java interpreter. most commercial software packages that are written in java also install some sort of interpreter as well as most of the java classes as part of installing the program. as far as JIT goes, from what i have read it looks like it just sets your path for java interpreter...so you would type 'HelloWorld' instead of 'java HelloWorld'. i would just write the program in C++ if you want an executable...

IMN logo majestic logo threadwatch logo seochat tools logo