to create exe file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • javaalien
    New Member
    • May 2007
    • 34

    to create exe file

    Could anyone gimme some inputs on how to create an exe file?
    This exe program is a counter to count how many of something - let's say
    "hello world" in a text file? Kindly please share some tips with me..
    Thank you in advance
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by javaalien
    Could anyone gimme some inputs on how to create an exe file?
    This exe program is a counter to count how many of something - let's say
    "hello world" in a text file? Kindly please share some tips with me..
    Thank you in advance
    What do you need an .exe file for? Java uses executable .jar files for that purpose.

    kind regards,

    Jos

    Comment

    • javaalien
      New Member
      • May 2007
      • 34

      #3
      Originally posted by JosAH
      What do you need an .exe file for? Java uses executable .jar files for that purpose.

      kind regards,

      Jos
      To count words in a text file.
      So I just need to click on the exe file to start counting.....
      Now I need to compile my application to jar ? thank you

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by javaalien
        To count words in a text file.
        So I just need to click on the exe file to start counting.....
        Now I need to compile my application to jar ? thank you
        You don't "compile to a jar". The jar tool is just like winzip: you compile your
        .java files to .class files as always and you bundle (and optionally compress)
        those .class files in a .jar file using the jar tool. You add a little "manifest" file
        to that jar. The manifest file tells the JVM what class to look for that contains
        the public static void main method. You can simply click on your .jar file to
        execute it.

        Read all about it in the Jar Documentation.

        kind regards,

        Jos

        Comment

        • hafij
          New Member
          • Jul 2007
          • 1

          #5
          How can i create an exe from jar

          Comment

          • odefta
            New Member
            • Jul 2007
            • 18

            #6
            It is possible to create an exe file from a java .class

            Make a shortcut - a create shortcut window appears... in 'type the location of the item textbox' insert the javaw command to point to the java class.
            For example: javaw Test.class

            Type next. A windows exe file will be created!

            Good luck

            Comment

            • vibhuti63
              New Member
              • Oct 2007
              • 1

              #7
              Originally posted by odefta
              It is possible to create an exe file from a java .class

              Make a shortcut - a create shortcut window appears... in 'type the location of the item textbox' insert the javaw command to point to the java class.
              For example: javaw Test.class

              Type next. A windows exe file will be created!

              Good luck
              HI .. i tried creating the shortcut , the .exe file was created alright , but when i tried opening it , there was an error message :


              JAVA VIRTUAL MACHINE LAUNCHER :
              could not find the main class . program will exit.

              what could be the reason??? could u plssss help me , i want my project to run like software ..
              thanx

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #8
                Originally posted by vibhuti63
                HI .. i tried creating the shortcut , the .exe file was created alright , but when i tried opening it , there was an error message :


                JAVA VIRTUAL MACHINE LAUNCHER :
                could not find the main class . program will exit.

                what could be the reason??? could u plssss help me , i want my project to run like software ..
                thanx
                Read the link I supplied in reply #4; there is absolutely no need to create .exe
                files or whatever. A simple executable .jar file is enough. Anything else is just
                an ugly hack that doesn't even run on other platforms.

                kind regards,

                Jos

                Comment

                • heat84
                  New Member
                  • Nov 2007
                  • 118

                  #9
                  when you have created your jar file , there is software called jar2exe which will convert the jar file to exe , however , the jar files may be sufficient without being converted to .exe files.

                  Comment

                  • JosAH
                    Recognized Expert MVP
                    • Mar 2007
                    • 11453

                    #10
                    Originally posted by heat84
                    when you have created your jar file , there is software called jar2exe which will convert the jar file to exe , however , the jar files may be sufficient without being converted to .exe files.
                    Any of such 'jar2exe' utilities are just dumb platform dependent hacks; they won't
                    work on anything non-MSWindows. There's no need to use them at all. Jar files
                    are fine, if only people would care to read instructions and know how to use the
                    single jar utility: platfrom independent and your java code would always work.

                    kind regards,

                    Jos

                    Comment

                    Working...