0

i have to do a program in BDK.my BDK and JDK are in the same folder java.
i have set the path for jdk/bin in control panel.i have created the jar file,
jar cfm [jar file name] [manifest file name] [java class name].
i didn't get any error there.

but in jdk when i try to load the jar file,it is giving me error saying that
"jar file doesn't have any beans.Each jar file needs to contain a manifest file describing
which entries are beans.you should provide a suitable manifest file"

my manifest file is first.mnf and the content is
Name: first.class
Java-Bean: True

my java file is first.java and the coding is as follows

import java.awt.*;
import java.io.Serializable;
  import java.beans.*;       
public class first extends Canvas implements Serializable{
 private Color color = Color.green;
 
 
  public Color getColor(){
     return color;
  }
 
    public void setColor(Color newColor){
     color = newColor;
     repaint();
  }
 
  public void paint(Graphics g) {
   g.setColor(color);
  g.fillRect(20, 5, 20, 30);
  }
 
 
  public first(){
   setSize(60,40);
   setBackground(Color.red);
  }

}

CAN ANYONE PLEASE HELP ME?

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by NIsha Smilee
0

Open in the jar file in WinZip or WinRAR to check if it actually contains any class file.

According to me the command for you case is :

jar cfm [jar file name] [manifest file name] [java class name].class.

And BTW please use code tags while including code in your posts

0

i did check the jar file using
jar xvf [jar file name]

it contains both manifest file and class file

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.