This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Simple Java Bean Devt Steps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply locked New topic

Simple Java Bean Devt Steps

Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2372

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 "".
3. Compile the source file(s).
I compiled with "javac" .
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!

Ashik Uzzaman
Lead Member of Technical Staff,, San Francisco, CA, USA.
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2372

I myself found the solution! Hurrah!! But no audience...
Well, last night i tried to modify the manifest file and found it working with the previous settings ..... there was no change but it worked....
So u can follow the above steps to make ur own simple beans....

Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9056
Good for you! Thank you for sharing your success.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
This is about regular JavaBeans and not EJB's so,
Check out the Sun tutorial on JavaBeans
This question should be ask in Other Java API's so, I'll move it there.

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
praseena nair

Joined: Mar 28, 2009
Posts: 4
hey ashik uzzaman...i know its really an old thread...but i was hoping just in case some one replies i can get my answer...

i am getting the same error i really want to know how was the error resolved??
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63202

Please do not re-open old threads, and do not post the same question more than once.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Simple Java Bean Devt Steps
It's not a secret anymore!