Makeing a .jar file or .exe

How can I make one of these. I read the tutorial but it doesn't make sense. Do I put the code into the program? Can I run the program on another computer by just taking the jar file on a disk. Can some one inform me and help me understand these compiling things.

As far as jar files go, you put .class files and dependent data files into a jar. For example, you can put an .jpg into a jar. You can run the application on another computer by copying the jar file to the other computer, assuming you created the jar correctly and the other computer has a compatible JVM installed.
As far as .exe files go, search the forums here using keyword .exe and you should be able to find some applications that create .exe files. Or try Google.

Similar Messages

  • How can i run a jar file as EXE on mouse click..

    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*

    amrit_j2ee wrote:
    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*Do you mean converting it from a jar file to an EXE file or do you mean that you would like to run the application by just double clicking it?
    If it's the latter then you need to make the jar file including a manifest.
    The manifest can be just a txt file with its content to be something like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: Somebody
    Main-Class: NameOfTheMainClass
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildTo make the jar file including the manifest, use something like this in your command prompt (of course you must have compiled your java file(s) first):
    jar cfm test.jar MANIFEST.txt NameOfTheMainClass.classAfter that you'd be able to run your application just by double clicking it.
    If you're a NetBeans user, you can build your standalone application by right-clicking your project and then going to properties => run => and choosing a Main class. After that right click on that project and "Clean and Build", locate the jar file in the "dist" folder and double click it =]
    Hope it helps,
    LD

  • Making Executable Jar file using java Application

    Following Program creates the jar file at specified location. but, I wonder why this file does not execute on double clicking on it, in spite of that the Manifest file contain correct main class file name
    //MakJar.java
    import java.io.*;
    public class MakJar
    public static void main(String[] args)throws IOException{
    Process p;
    String str="D:\\Himesh\\JFiles";
    try {
    BufferedWriter out = new BufferedWriter(new FileWriter(str+"\\mainClass.txt"));
    out.write("Main-Class: TestFrame\n");
    out.close();
    } catch (IOException e) {
    try
         p=Runtime.getRuntime().exec("cmd /c D:\\Java6\\jdk1.6.0\\bin\\javac.exe "+str+"\\TestFrame.java");
         p=Runtime.getRuntime().exec("cmd /c D:\\Java6\\jdk1.6.0\\bin\\jar cvmf "+str+"\\mainClass.txt "+str+"\\Demo.jar "+str+"\\*.class");
    catch(IOException e)
    System.err.println("Error on exec() method");
    e.printStackTrace();
    }

    Sir,
    On execute the jar using a "java -jar. . ." command. it gives the error--
    "Exception in thread "main" java.lang.NoClassDefFoundError : TestFrame"
    On Extracting the files from jar file made by the java program,i found that the manifist file ( containing the name of main class) and t the class file are included in the jar file.
    But if I make the jar file manually it works perfectly.I have even reinstalled the java but the problem persists
    Same thing happen if i use MS-DOS batch file.
    ??????If i put the batch file in the same directory and execute it The resulting jar file works,But
    ??????if the batch file is executed from outside the directory The resulting jar file fails execute.
    what should i do???

  • Help with a question about making/running .jar files.

    First i have a question, can i make a .jar file that can run on a computer without JRE installed. And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearchAnd im using the command:
    jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

    dford425 wrote:
    First i have a question, can i make a .jar file that can run on a computer without JRE installed. No, not unless you package the JRE with your dist. Hence the name JRE (Java Runtime Environment).
    And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearch
    That simply means your not pointing the runtime to the classes. Set your CLASSPATH environment variable correctly and it will run (given you have a JRE which it appears you do).
    And im using the command:
    jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

  • Making executable jar file the database using JTable

    How can i make an executable jar file if I will use a JTable on my database?Can you tell me how?
    Thank you !!

    dantte wrote:
    in truth, ur question is not clear enough. elaborate on what exactly it is u want, and what u ar truin to achieve.You don't seem to know enough English, let along Java, to be answering questions here.
    %

  • Making excecutable jar file which contains folder

    hi,
    I have a strange (at least for me it is) problem. I made an excecutable *.jar file of one of my projects. The problem is, that it only works if the *.jar file is in the same folder as my project.
    my project uses subfolders. i noticed, that if i deleted everything, leavin only the *.jar file and the folders, then it works.
    so my question is: how can i tell my java programm to look for the folders inside the jar file?
    yes, i did put all folders inside the jar file and yes i used relative paths within my programm.
    thanx
    Usul

    for example:
      analysePoints.addImage(new File("Candidates", "A.png"));
      analysePoints.addImage(new File("Candidates", "Circle.png"));
      analysePoints.addImage(new File("Candidates", "Cross.png"));
      analysePoints.addImage(new File("Candidates", "Heart.png"));
      analysePoints.addImage(new File("Candidates", "TriangleN.png"));
      analysePoints.addImage(new File("Candidates", "TriangleSW.png"));or
       while( helpInt < pathsToImagesVT.size() )
         File currentImagePath = (File)pathsToImagesVT.elementAt(helpInt);
         Image currentImage = null;
        try{
          currentImage = getToolkit().createImage(currentImagePath.getCanonicalPath());
          MediaTracker helpMT = new MediaTracker(this);
          helpMT.addImage(currentImage,0);
          helpMT.waitForAll();
         } catch(InterruptedException e) {System.out.println(e.toString());}
           catch(IOException f){System.out.println(f.toString());}

  • Making a JAR file publicly available

    Hi SDN,
    <b>
    I have created a JAR file. There are several DCs. All of these DSs have to access this JAR file. Therefore I want to make this JAR file centrally available in the portal. How can I do that???
    </b>
    regards
    Brahmachaitanya

    In the J2EE Library you only have to include the jar that you want to make visible for all applications.
    To do this you create a J2EE Server Component -> Library, and in the server/provider.xml you add the desired jar in the "jars" tab. It has to be located in the workspace.
    Then you build the sda file and deploy it to the server.
    I am not very sure about the properties file that you comment. I Suppose that when you add the SharingReference of the J2EE Library what does is to include it in the classpath of the portal application you are running. Maybe you can put the properties file into PORTAL-INF/classes which reference the library and all works correctly.
    Tell me if you manage to do this. I´m interested in it.

  • Making labview .vi file to exe file

    hi all,
    i am using labview 8.5 professional version. how to made the labview vi file to exe file?

    mic_k86 a écrit:
    i think i have find the way to make the exe file. however, i hv problem with my lvm file. how to make the lvm file can be detected by the exe file (when exe file running will save the data to the lvm file)?
    Right-click the lvm file, then "Open with...", select your .exe application and make it the default application. 
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Converting Jar files into Exe

    Can anyone suggest me a free tools for converting jar files into executable??
    Thanks

    thanks
    i have few questions about launch4j
    my application depends upon other jar files also like log4j.jar etc. Can i merge all the dependencies into the executable itself for better management of file? Is it possible in launch4j??
    and is it possible to extract my source code from executable file using reverse engineering techniques??

  • Converting jar file to .exe

    hi I have installed NativeJ to convert my java application to .exe file
    It was converted and it is working.
    But while clicking the setup file it has to be installed in the local system .if the jre is not installed first it should install jre and it has to install our application.before installing our application to local system it has to ask the path where it should be installed.
    please give me some suggestion.

    Multipost
    http://forum.java.sun.com/thread.jspa?messageID=10025921

  • Making a .java file a .exe file

    Hello, well I recently finished a program i'd been working on and I need to put it into some sort of file (I dunno if its an exe or not) so that I can run it from other places than just my compiler. How to I do that?

    wow, thanks for being helpful O_o. Seen I obviously
    didn't do the right thing then wouldn't you presume I
    had no idea and would have told me what to correctly
    put? Obviously not...No, I didn't want to assume that you are so clueless that you can't even handle your own operating system. I rather thought I'd cut you some slack and assume you overlooked it. After all, you didn't ask something like "how do that in Windows XP/98/whatever" which would have hinted at you not knowing how to set the path, and which would have given me a chance to explain it to you, since it works differently for different versions of Windows, IIRC.

  • Jar file helper application

    I have a file extension (.hgf) that I would like to associate with with a Java jar file. I'm running Ubuntu 11.11 and in Dolphin (the file manager GUI) I use "java -jar ~/Havannah/HGui/HGui.jar" as my 'open with' and clicking on hgf files in Dolphin will automatically run my HGui.jar program with the clicked file as input.
    When I try to do the same thing in Friefox with 'open with' I cannot get it to work. The file gets saved in /tmp but HGui never seems to run on it. I've tried various combinations of quotes, putting the command into a shell script, etc., but cannot seem to get the click and open behavior I would love to see.
    Thanks in advance for any suggestions you might have!

    Simply putting the path to the jar file (making no mention of Java) and making the jar file executable was enough to make it work. This did not work in Dolphin so I did not even try it in Firefox -- until I got desperate.

  • Creating War , not Jar file.

    I am trying to create my EJB and i created my web project. The problem seems that my JBoss will not recognize and deploy my table perhaps due to the structure of the war file.
    My entities are working perfectly as they work, and have already been tested.
    ANyway, what i want is some help into getting my build.xml into making a jar file and sending that one instead of the the war file..
    Can someone please let me a link of where i should look ? Or what i should include in the xml file in order to create the file
    sTevoo.
    P.s - I am using netbeans 6
    Ps - I wasnt sure if i had to post here or in the Deploying - Java Archive (JAR) Files

      <property name="jboss.deploy.dir" value="/home/stevoo/jboss-4.2.2.GA/server/default/deploy"/>
        <property name="librarydir" value="${basedir}/lib"/>
        <property name="src.dir" value="src"/>
        <property name="build.dir" value="build"/>
        <property name="dist.dir" value="dist"/>
        <property name="bin.dir" value="bin"/>
        <target name="prepare">
            <delete dir="${bin.dir}"/>
            <mkdir dir="${bin.dir}"/> 
            <mkdir dir="${bin.dir}/META-INF"/>
        </target>
        <!--Set Libs-->
        <path id="libraries">
            <fileset dir="${librarydir}">
                <include name="*.jar"/>
                <include name="*.zip"/>
            </fileset>
        </path>
        <target name="compile1" depends="prepare">
            <javac srcdir="${src.dir}" destdir="${bin.dir}">
                <classpath refid="libraries"/>
            </javac>
            <echo message="Compile ...." />
        </target>
        <target name="compile" depends="compile1">
            <copy file="${src.dir}/conf/log4j.properties" todir="${bin.dir}/META-INF/"/>
            <copy file="${src.dir}/conf/MANIFEST.MF" todir="${bin.dir}/META-INF/"/> 
            <copy file="${src.dir}/conf/persistence.xml" todir="${bin.dir}/META-INF/"/>
            <jar basedir="${bin.dir}" destfile="${dist.dir}/test.jar"/>
            <echo message="Build...." />
        </target>
        <target name="run" depends="compile">
            <copy file="${dist.dir}/test.jar" todir="${jboss.deploy.dir}"/> 
            <echo message="Run ... ${jboss.deploy.dir}"/>
        </target>
        After a whole day of changing and tweaking and all .... this sort of works.
    Some more tweakong and done.
    Just in case any one else wants this,,,

  • Jar file of Helliker.ID3 package

    Hey guys,
    I am facing a problem with making a jar file of hellikar.id3 package.I am importing hellikar.id3.ID3v2FormatException class but it is giving class not found error.I tried to set the classpath but its not working.Can any body please tell me how i should make the jar file helliker.id3.jar so that i can add it in lib/ext directly.
    Please tell about how i can use jar cvf filename.jar   with regard to class hierarchy.I created a jar file but it is not working so i figured out that there must be a problem with from where(directory) to make the jar file on command prompt.*

    Thespian wrote:
    Please tell about how i can use jar cvf filename.jar   with regard to class hierarchy.I created a jar file but it is not working so i figured out that there must be a problem with from where(directory) to make the jar file on command prompt.*Have you tried the Jar tutorial? [http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]
    If you have gone through a tutorial and still have problems, I suggest you post a short example of what you try to do and what does not work. Include commands you use and error messages you get.

  • Quick Question **PLEASE HELP** .jar file?

    Hey everyone, im pretty new to the java scene but I have a really quick question that hopefully someone can help me with.
    I'm really interested in making a .jar file out of my code. And basically I just want to make one. but i understand there are certain things like main class's, etc. that need to be made in order to make a .jar file.
    So basically Say I opened up a new project in blueJ. I made 1 new class called "main." Inside of it I had nothing for conductors and no variables declaired untill the bottom part where i write my code.
    say i write...
    System.out.println("hello");
    and that is it.
    What steps from there do i do to make a jar file and have it be able to be executed and SEE the "hello" printed somewhere NOT in blueJ??
    (I understand there is something about a "static" method? Im not really sure but if somoene could enlighten me on how to make a .jar file that would be great.)
    Thanks a lot everyone!
    Tom

    I don't know anything about BlueJ, but this section of Sun's tutorial explains how to
    write a program that outputs a single line of text to the console:
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
    Deploying an application as an executable .jar file is covered here:
    http://java.sun.com/docs/books/tutorial/deployment/jar/index.html
    The first two sections - "Using JAR Files: The Basics" and "Working with Manifest
    Files: The Basics" - contain the information you need to understand this process.

Maybe you are looking for

  • Need Win XP drivers for Satellite A100 (PSAA2)

    Dear all! I had an troyan horse program, so I have formated by Portion Magic. I have installed 2 new Windows (Recovery cd-rom for XP is corrupted) on "C" and "D" , but there are some problems now: the following things are listed with an "?" in the de

  • Many external hard drives - stop asking to use Time Machine!

    I do a lot of video editing on my machine, and have a lot of clients' external drives plugging into my machine. Usually, we are doing this under a tight deadline, where every extra little mouse click counts -- and with each new drive, Time Machine al

  • GPU Acceleration in Lightroom CC

    This is the page talking about GPU usage in Lightroom CC: Adobe Photoshop Lightroom Help | Lightroom GPU FAQ. This is the page talking about GPU usage in Photoshop: Photoshop CC and CC 2014 GPU FAQ As you can see, I havn't seen much details about the

  • Changing a field based on another field

    hi one and all i am looking for a way to change a field based on another field. if i have item 2 and item 8 on the page and item 8 needs to be required based on item 2 based on a requirement, how would this be done. ex if item 2 has a PO inputed, whe

  • RMAN Report

    Hi, I am using ORACLE 10.2 G. I have done the following on my pc : ALTER TABLESPACE USERS BEGIN BACKUP; CREATE TABLE NOTBACKEDUP(ID INTEGER, STR VARCHAR(16)) TABLESPACE USERS; INSERT INTO NOTBACKEDUP VALUES(1, 'ROW 1'); INSERT INTO NOTBACKEDUP VALUES