java executable format without jvm

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karthickRAJKUMAR
    New Member
    • Sep 2007
    • 46

    #1

    java executable format without jvm

    i had created the java application in swing and convert into class file and into jar finally i use the third party tool to convert inte exe,the problem was i cant able to run the exe in another system because it does n't have jre .my question was whether we able to run the program without jre

    for exmple when we download the software from net and install into our system without know which language that the software was developed,how it possible why i cant?thank u
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by karthickRAJKUMA R
    i had created the java application in swing and convert into class file and into jar finally i use the third party tool to convert inte exe,the problem was i cant able to run the exe in another system because it does n't have jre .my question was whether we able to run the program without jre

    for exmple when we download the software from net and install into our system without know which language that the software was developed,how it possible why i cant?thank u
    What third party tool did you use?
    All I know is that you need to have the JRE installed for you to run jar files. Most Java programmers never need to make .exes. I don't know what your .jar to .exe convertor was doing so I can't say the .exe is not running.

    Comment

    • karthickRAJKUMAR
      New Member
      • Sep 2007
      • 46

      #3
      Originally posted by r035198x
      What third party tool did you use?
      All I know is that you need to have the JRE installed for you to run jar files. Most Java programmers never need to make .exes. I don't know what your .jar to .exe convertor was doing so I can't say the .exe is not running.
      [code=java]
      //Author: Syed M Hussain
      //Date: 07/02/06
      //Description: Load multiple JLabel using a loop.
      //www.java.codeyo urself.com
      //www.codeyoursel f.com

      import javax.swing.*;
      import java.awt.*;

      public class MultipleJLabels

      {
      public static void main(String args[])
      {
      MultipleJLabels newMultipleJLab els = new MultipleJLabels ();
      newMultipleJLab els.Display();
      }

      public void Display()
      {
      int top=0;

      JFrame frame = new JFrame("Multipl e JLabels");
      JPanel pane = new JPanel();
      frame.getConten tPane().add(pan e);

      JLabel[] label = new JLabel[5];

      for (int i=0; i <=4;i++)
      {
      label[i] = new JLabel("JLabel: " + i);
      label[i].setSize(100,20 );
      label[i].setLocation(0, top);
      top=top+25;
      pane.add(label[i]);
      pane.setLayout( new BorderLayout()) ;
      }

      frame.setSize(2 00,200);
      frame.setVisibl e(true);
      }

      }
      [/code]

      this my java file ,i just comile using java compiler and make to byte code,and i use to change inito am jar file,then i download the tool which use to convert jar to an exe(if click the icon the file will execute autmatically in adesktop),it run in my system but when copy te file to other system it will give the error message,my question is whether it any possibility run the file without jre.we download the software in the net without have idea of technology and run it in our system for example we download yahoomessenger and run in our system without having any knowledge of their technology
      Last edited by JosAH; Nov 2 '07, 07:52 AM. Reason: Added [code] ... [/code] tags

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        I normally ship and deploy my Java applications using an installer: it installs my
        jar(s) as well as a JRE on the target machine. The user doesn't know that her
        machine contains any Java technology.

        kind regards,

        Jos

        Comment

        • karthickRAJKUMAR
          New Member
          • Sep 2007
          • 46

          #5
          Originally posted by JosAH
          I normally ship and deploy my Java applications using an installer: it installs my
          jar(s) as well as a JRE on the target machine. The user doesn't know that her
          machine contains any Java technology.

          kind regards,

          Jos
          u cant able to get my question

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by karthickRAJKUMA R
            u cant able to get my question
            I beg your pardon?

            Jos

            Comment

            • karthickRAJKUMAR
              New Member
              • Sep 2007
              • 46

              #7
              Originally posted by JosAH
              I beg your pardon?

              Jos
              i not mean like that i cant able to convey my question sorry

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #8
                Originally posted by karthickRAJKUMA R
                i not mean like that i cant able to convey my question sorry
                I do understand you: you want to create a single executable (.exe) file out of a
                bunch of .java source files. I am trying to tell you (repeatedly) that this is not the
                way Java works, i.e. you create executable .jar files and install a virtual machine.

                In my previous reply I mentioned that you can install that virtual machine using a
                proper installer. It installs the java virtual machine together with the .jar file(s) that
                contain your application code.

                kind regards,

                Jos

                Comment

                • karthickRAJKUMAR
                  New Member
                  • Sep 2007
                  • 46

                  #9
                  thank josh,i have assign the work to do in jasper report,which will give the report dynamically,ple ase give some idea i am not able to find the solution yet(dynamically insence we have to sent the value in textbox using swing and should able to sent the report in pdf

                  Comment

                  • karthickRAJKUMAR
                    New Member
                    • Sep 2007
                    • 46

                    #10
                    thank josh,i have assign the work to do in jasper report,which will give the report dynamically,ple ase give some idea i am not able to find the solution yet(dynamically insence we have to sent the value in textbox using swing and should able to sent the report in pdf

                    Comment

                    • jez
                      New Member
                      • Nov 2007
                      • 1

                      #11
                      Well, its not uncommon question to ask, but still unresolved. Why to install whole jre, when you made just funny applet. (anyway, Josah, what installer do you normally use?)

                      During my searching I found a program which functiones exactly like what I would need. See here http://www.kytara.cz/download/chords/chords12ee.zip

                      He copied all the needed classes(this means all imports, including implicit java.lang.*) into classes.zip and included java.exe Then the program is run by .bat which calls

                      java.exe -classpath cclasses.zip;ch ords.jar chords.ChordsAp pl

                      so it starts the main classChordsAppl . It is awesome, it works without any jre at all and zipped it has about 1.3MB. The drawback is, that it is made in java 1.1 and I failed to remake it to java 1.6 It just wouldnt run on computer without jre.

                      Thanks for any comments.

                      Comment

                      • JosAH
                        Recognized Expert MVP
                        • Mar 2007
                        • 11453

                        #12
                        Originally posted by jez
                        Well, its not uncommon question to ask, but still unresolved. Why to install whole jre, when you made just funny applet. (anyway, Josah, what installer do you normally use?)

                        During my searching I found a program which functiones exactly like what I would need. See here http://www.kytara.cz/download/chords/chords12ee.zip

                        He copied all the needed classes(this means all imports, including implicit java.lang.*) into classes.zip and included java.exe Then the program is run by .bat which calls

                        java.exe -classpath cclasses.zip;ch ords.jar chords.ChordsAp pl

                        so it starts the main classChordsAppl . It is awesome, it works without any jre at all and zipped it has about 1.3MB. The drawback is, that it is made in java 1.1 and I failed to remake it to java 1.6 It just wouldnt run on computer without jre.

                        Thanks for any comments.
                        If you included java.exe you have included the entire virtual machine. btw I use
                        IzPack for the installation of my applications.

                        kind regards,

                        Jos

                        Comment

                        Working...