Results 1 to 15 of 15
  1. #1
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default How to change into an .exe file.

    Hi! I would like to know the following:
    1. Is it possible to change multiple java files into an .exe file so that you could just click on an icon and run the program.
    2. After conversion if you still need a program like Jgrasp to run the written program.
    3. What program do I need to covert the files.

    Please feel free to explain the proses and the answers when you answer them as this would be MUCH appreciated!:(:)

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,431
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Johanis View Post
    Hi! I would like to know the following:
    1. Is it possible to change multiple java files into an .exe file so that you could just click on an icon and run the program.
    2. After conversion if you still need a program like Jgrasp to run the written program.
    3. What program do I need to covert the files.

    Please feel free to explain the proses and the answers when you answer them as this would be MUCH appreciated!:(:)
    Read about the creation and manipulation of .jar files; you don't transform a bunch of .class files to an executable .exe file. You can simply double click on a .jar file to run it if you have set it up correctly.

    kind regards,

    Jos

  3. #3
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    Read about the creation and manipulation of .jar files; you don't transform a bunch of .class files to an executable .exe file. You can simply double click on a .jar file to run it if you have set it up correctly.

    kind regards,

    Jos
    Thanx where can I read up about this? Can't you explain how to do it?

  4. #4
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    Not really very easy to explain. Also, there are probably quite a few people who distribute jar files that could never do it from the command line, myself among them.

    Eclipse can create jar files for you, and most other IDEs probably can, but if you don't have an IDE that can do it, or want to learn how to create JAR files on your own, read through this part of the Oracle Java Tutorials.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  5. #5
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    haha thanx I will try my best to figure this out! That's really cool of you...You must be a hard working and determent person! :)

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    There are some tools which can convert jar/java class files into executables. But I didn't see any point to do that, since it's only work in Windows platforms.

  7. #7
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    Quote Originally Posted by Eranga View Post
    There are some tools which can convert jar/java class files into executables. But I didn't see any point to do that, since it's only work in Windows platforms.
    Thants Ok because at least people with Windows could use it.:) Can you PLEASE give me the link to the tools??

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,431
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Johanis View Post
    Thants Ok because at least people with Windows could use it.:) Can you PLEASE give me the link to the tools??
    Realize that those .exe files have to store (almost) the entire jvm and a lot of compiled classes while the jvm itself can compile the byte code in the .class files to machine executable code by its JIT (Just In Time) compiler and its HotSpot mechanism; i.o.w. there is almost no use to transform a bunch of .class files to executable code because the JVM does the same when it runs.

    kind regards,

    Jos

  9. #9
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    5

    Default

    Quote Originally Posted by Johanis View Post
    Can you PLEASE give me the link to the tools??

    here is one: Launch4j

  10. #10
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Question

    Quote Originally Posted by JosAH View Post
    Realize that those .exe files have to store (almost) the entire jvm and a lot of compiled classes while the jvm itself can compile the byte code in the .class files to machine executable code by its JIT (Just In Time) compiler and its HotSpot mechanism; i.o.w. there is almost no use to transform a bunch of .class files to executable code because the JVM does the same when it runs.

    kind regards,

    Jos
    But I want to be able to just click on a icon and then the program must run...or is that what you are explaining to me now?: that it would be the same?

  11. #11
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    Quote Originally Posted by j2me64 View Post
    here is one: Launch4j
    THANX! (i rep you)

  12. #12
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by JosAH View Post
    Realize that those .exe files have to store (almost) the entire jvm and a lot of compiled classes while the jvm itself can compile the byte code in the .class files to machine executable code by its JIT (Just In Time) compiler and its HotSpot mechanism; i.o.w. there is almost no use to transform a bunch of .class files to executable code because the JVM does the same when it runs.

    kind regards,

    Jos
    What's the point of bundling jvm in executable. Normally those could leave as pre-request to install the application.

  13. #13
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by j2me64 View Post
    here is one: Launch4j
    Yep, Launch4j is the one I used in most of the cases when I want to build an executable, which I hate to do. ;)

  14. #14
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    Quote Originally Posted by Eranga View Post
    Yep, Launch4j is the one I used in most of the cases when I want to build an executable, which I hate to do. ;)
    haha LOL...Why do you hate to do it? I have the program now, but have no idea of how to operate it. I'm not sure if you can use a .java file? Whats the steps to do this operation?

  15. #15
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Java file, you cannot distribute as it is. Because then you've to compile it before run on clients' end. So the client has to install JDK version which compatible to compile your Java class, and waste some space of his/her HDD. Deploy it as a jar package or a executable (which I'm not recommended).

    Do you know how to deploy JAR packages?

Similar Threads

  1. Replies: 2
    Last Post: 02-19-2014, 05:36 PM
  2. Change the icon of file in java
    By smn in forum SWT / JFace
    Replies: 18
    Last Post: 10-06-2010, 04:55 PM
  3. Replies: 8
    Last Post: 05-12-2010, 07:19 PM
  4. Replies: 0
    Last Post: 04-05-2008, 10:10 AM
  5. Is it possible to change the '\n' into ' ' ...
    By johnny7white in forum New To Java
    Replies: 1
    Last Post: 11-15-2007, 02:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •