File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "jar " Watch "jar " New topic


Nancy Bradley
Ranch Hand

Joined: Feb 25, 2004
Posts: 32
Please help! I need to create a jar file this is what I wrote:
jar cf Rectangle1.jar Rectangle1.class
when I checked to see what was in jar file, I am missing Rectangle.class.It is save in the same folder as Rectangle1. How can I added to the file?
I would also like to know how to run a jar file?
Thanks for your help
Nancy B
[ April 05, 2004: Message edited by: Nancy Bradley ]
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
I am missing Rectangle.class
I'm not sure if this is a typo. Did you mean Rectangle1.class?
If not, then perhaps Rectangle.class isn't in the JAR because you didn't instruct the jar program to include it, as you instructed it to include Rectangle1.class.
If it is a typo, then are you sure that the Rectangle1.class is in the same working directory that you used when running the jar program?
I would also like to know how to run a jar file
Take a look at the Creating an Executable JAR File thread.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Nancy Bradley
Ranch Hand

Joined: Feb 25, 2004
Posts: 32
Thank you.
Rectangle.class contains code that should calculate area and perimeter of a rectangle and Rectangle1 is an applet that should test it.
I did not include it when crated the jat file.
The information that you provide in the jar thread is very helpful. I will try again tonight
Nancy B
I agree. Here's the link:
subject: jar
Similar Threads
Frames in JSP
sending an e-mail
What is life
how to deal with the property file that could be modified by user
What am I doing wrong? I get garbage