Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What am I doing wrong? I get garbage

 
Nancy Bradley
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ashok C. Mohan
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much
Nancy B
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic