| Author |
What am I doing wrong? I get garbage
|
Nancy Bradley
Ranch Hand
Joined: Feb 25, 2004
Posts: 32
|
|
I try to create a jar file that contains a Rectangle.class and an applet Rectangle1 that will test Rectangle.class This is what I wrote: jar cf lab6.jar Rectangle1.class Rectangle.class The lab6.jar file was created, but when I tried to run it I got a bunch of symbols. I run it by typing: java-jar lab6.jar What did I do wrong? Please help! Thank you Nancy B
|
 |
Ashok C. Mohan
Ranch Hand
Joined: Dec 03, 2003
Posts: 75
|
|
You will have to edit the manifest file in the jar to point to your main class. Try adding this line.... Main-Class: classname Replace classname with your main class file name.
|
SCJP 1.4
Do not dwell in the past, do not dream of the future, concentrate the mind on the present moment.
|
 |
Ashok C. Mohan
Ranch Hand
Joined: Dec 03, 2003
Posts: 75
|
|
If you are using an applet then try calling it from an html page like this... <applet code=mainclassname.class archive="jarname.jar" width=120 height=120> </applet> make sure the html and jar file are in the same directory.
|
 |
Nancy Bradley
Ranch Hand
Joined: Feb 25, 2004
Posts: 32
|
|
Thank you very much Nancy B
|
 |
 |
|
|
subject: What am I doing wrong? I get garbage
|
|
|