This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Jar file " Watch "Jar file " New topic
Author

Jar file

Mike Shn
Ranch Hand

Joined: May 26, 2001
Posts: 149
I want to make a jar file which contains three files(ComplexNumber.java, Panel.java and Mandelbrot.java(applet). Therefore, the file which I want to create contains 3 files and how can I make the file to run from the command line. Also does this possible that a user take a floppy, inserts to floppy drive and runs the applet Mandelbrot.java(from the jar file).
Thanks
Shiva Kumar
Ranch Hand

Joined: Feb 09, 2001
Posts: 30
Hi,
make a Manifest File with the following contents and while making jar use the created manifest file.
Manifest file contents
Manifest-Version: 1.0
Main-Class: Main Class Name
Created-By: 1.3.0rc2 (Sun Microsystems Inc.)
jar cvmf < manifestfilename> < jarfilename> *.class
For applet
< applet code=AppletClassName codebase="." archive="jarfilename.jar"> < /applet>

Shiva.
(Marilyn put spaces after < s)
[This message has been edited by Marilyn deQueiroz (edited November 27, 2001).]
Shiva Kumar
Ranch Hand

Joined: Feb 09, 2001
Posts: 30
Hi,
make a Manifest File with the following contents and while making jar use the created manifest file.
Manifest file contents
Manifest-Version: 1.0
Main-Class: Main Class Name
Created-By: 1.3.0rc2 (Sun Microsystems Inc.)
/* jar cvmf manifestfilename jarfilename *.class */
For applet
applet code=AppletClassName codebase="." archive="jarfilename.jar"

Shiva.
Mike Shn
Ranch Hand

Joined: May 26, 2001
Posts: 149
but I have to write the html file? or not? I mean it's necessary to write the html file and insert the Appplet to it. Would you give me some example for it?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Jar file
 
Similar Threads
Applet Jar Download
Java Script that allows to paste in temp folder
applet doesn't get gif in browser from jar
This can be done, but the question is HOW?
difference between .jar and .war files