Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to run a java class file direct from Windows Explorer?

Reply
Thread Tools

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

 
 
Bengan
Guest
Posts: n/a
 
      07-19-2003

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
 
Reply With Quote
 
 
 
 
Kyle Walz
Guest
Posts: n/a
 
      07-20-2003
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
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      07-20-2003
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.
 
Reply With Quote
 
Bengan
Guest
Posts: n/a
 
      07-20-2003

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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VERY Urgent Direct Client Needs : 9 JAVA/J2EE (core JAVA) must hv expon Finance indstry. sarah Fernandes Java 0 03-09-2011 05:16 PM
DLLs loading in interpreter but not with direct run on Windows JTimoty Python 3 04-26-2010 10:53 AM
run rb. file in a .rb file (linke run->runfile) Dave Dave Ruby 0 12-15-2008 02:43 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
I am a newbie ! Pls help! VS.net direct x 9 sample problem Unable to run supo C++ 1 07-21-2003 07:20 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57