wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies 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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Simple Java Bean Devt Steps" Watch "Simple Java Bean Devt Steps" New topic
Author

Simple Java Bean Devt Steps

Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

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!


Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

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
Sheriff

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


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

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple Java Bean Devt Steps