How to run a java class file direct from Windows Explorer?

Discussion in 'Java' started by Bengan, Jul 19, 2003.

  1. Bengan

    Bengan Guest

    Hi,

    I want to run my java files just by double clicking on them in Windows Explorer
    or through a shortcut. How do you do that? I want it to be easy for my friends
    to run them. What more do a person need to run the java application? Is it
    enough with the java virtual machine or most you have the complete Java(TM)
    2 Runtime Environment/Java(TM) 2 SDK?

    Thanks in advance
    /Bengan
     
    Bengan, Jul 19, 2003
    #1
    1. Advertising

  2. Bengan

    Kyle Walz Guest

    I'm guessing by saying Windows Explorer, you mean, for example,
    opening My Documents and double clicking something and it runs. Make
    a self executable jar file.

    Jar your classes and include a manifest.mf file. In the manifest file
    you need to state the main class and (for packages) the class path:

    Main-Class: package/Application
    Class-Path: package

    Put the manifest file in a folder named META-INF and your package
    folder in the same folder. I place these in a folder I made just for
    jarring (work/META-INF and work/package). Navigate to the folder with
    the meta and package folder (work in my example). Then at the command
    line for this folder type:

    jar cvmf META-INF/manifest.mf jarFile.jar .

    Or, use JavaJar from Pivotonic (http://www.pivitonic.com). :)

    Then, the person needs the JVM to run the jar. Hope this helps.

    Kyle
     
    Kyle Walz, Jul 20, 2003
    #2
    1. Advertising

  3. Bengan

    Roedy Green Guest

    On 19 Jul 2003 22:22:19 GMT, "Bengan" <> wrote or quoted :

    >I want to run my java files just by double clicking on them in Windows Explorer
    >or through a shortcut. How do you do that?


    see http://mindprod.com/jgloss/jar.html

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jul 20, 2003
    #3
  4. Bengan

    Bengan Guest

    Thanks for your answer. What JVM does the user need to have to run my applications.
    I'm not quite sure what on java.sun.com homepage different download packages
    is enough to just run a java application. There is one called Java VM and
    it's about 8mb. Is it enough with this? Under the link J2SE 1.4.2 SDK there
    is a column named JRE, is it perhaps this JRE you need?

    Then i wonder if you have any suggestion of how to distribuate the jvm to
    the user with my application in a simple way.

    /Bengan

    (Kyle Walz) wrote:
    >I'm guessing by saying Windows Explorer, you mean, for example,
    >opening My Documents and double clicking something and it runs. Make
    >a self executable jar file.
    >
    >Jar your classes and include a manifest.mf file. In the manifest file
    >you need to state the main class and (for packages) the class path:
    >
    >Main-Class: package/Application
    >Class-Path: package
    >
    >Put the manifest file in a folder named META-INF and your package
    >folder in the same folder. I place these in a folder I made just for
    >jarring (work/META-INF and work/package). Navigate to the folder with
    >the meta and package folder (work in my example). Then at the command
    >line for this folder type:
    >
    >jar cvmf META-INF/manifest.mf jarFile.jar .
    >
    >Or, use JavaJar from Pivotonic (http://www.pivitonic.com). :)
    >
    >Then, the person needs the JVM to run the jar. Hope this helps.
    >
    >Kyle
     
    Bengan, Jul 20, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. NewTel
    Replies:
    2
    Views:
    483
    G. Whiz
    Feb 23, 2006
  2. supo
    Replies:
    1
    Views:
    388
    Aggro
    Jul 21, 2003
  3. Steve Kershaw
    Replies:
    0
    Views:
    418
    Steve Kershaw
    Aug 21, 2007
  4. Ed Hauptman
    Replies:
    7
    Views:
    1,024
    Ed Hauptman
    Aug 7, 2009
  5. JTimoty
    Replies:
    3
    Views:
    301
    JTimoty
    Apr 26, 2010
Loading...

Share This Page