Hi friends,
I did the following steps to create a simple
Java Bean (not
EJB) and it went well until i tried to get my Bean in the BDK1.1
IDE. After successful compilation, i hoped according to the book that it will be there....but it was not....
Am i making some mistake? I m giving here the steps i followed with descriptions and the code....lemme know if i have forgotten something....
/** My first Bean thru coding. The steps invloved are.....
1. Create a directory for the new bean.
I saved it in my c:\bdk\demo\sunw\demo\colors
2. Create the Java source file(s).
I saved it as "Colors.java".
3. Compile the source file(s).
I compiled with "javac Colors.java" .
4. Create a manifest file.
I saved two gif files also named "blob.gif" and "apv.gif" in the "colors" directory.
I created the following manifest file naming "colors.mft" and the code was ---
Name: sunw/demo/colors/apv.gif
Name: sunw/demo/colors/blob.gif
Name: sunw/demo/colors/Colors.class
Java-Bean: True
The "Java-Bean: True" statement must immediately follow the class file that is a bean and no space between 'Name' and ':' , 'Java-Bean' and ':' is allowed.
I saved it in "c:\bdk\demo" because manifest files in bdk are saved here always.
5. Generate a JAR file.
Then to create the jar file i gave the command in DOS--
jar cfm c:\bdk\jars\colors.jar c:\bdk\demo\colors.mft c:\bdk\demo\sunw\demo\colors\*.class c:\bdk\demo\sunw\demo\colors\*.gif
A jar file is generated in "c:\bdk\jars" names "colors.jar" .
6. Start the BDK.
Go to "c:\bdk\beanbox" and type 'run' in command prompt.
7. Test the newly created Java Bean.
*/
------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!