NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Create manifest, jar and class file in netbeans

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Suchitto Palit
Posted via mailing list.





PostPosted: Thu Apr 23, 2009 12:51 pm    Post subject: Create manifest, jar and class file in netbeans Reply with quote

JavaBeans wrote:
Quote:

HI i am new to netbeans and i am using netbeans 6.1 and i was trying to to
the tutorials on netbeans.org
where i am asked to create a manifest, jar and class file. But I could not
understand the tutorial on 6.1. I think it is completely different. Can
someone help me with this.

http://java.sun.com/docs/books/tutorial/javabeans/writingbean/index.html
i am trying to do the tutorial on this. They have asked me to put the code
i didn't know where to put the code without creating a project.



Hi,
This is about 8 months late to answer ur question. But I saw ur question
just 2day. The XML script at the URL u mentioned, is actually a build script
for Apache Ant. U need that script when u r running Ant stand-alone. When u
r building your project from NetBeans, u don't need that script to create a
manifest, class and jar file. Instead do the following (assuming ur
"SimpleBean.java" is under "SimpleBean Project" and in a package
"com.simple.bean.practice" )

A> Go to the Files window. Under the Project Root ( SimpleBean_Project )
there is a file named manifest.mf. Double click that file to open it in the
Editor Window.

B> There should already be a Section consisting of 2 Headers in the
manifest as shown below.
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build

C> Add the following two lines in the manifest, separated from the existing
Section , by an empty line. Further add an empty line at the end of the
newly added Section, to denote the termination of the manifest file.

Name: com/simple/bean/practice/SimpleBean.class
Java-Bean: True

Notice the empty lines in between the 2 Sections and at the at the end of
the manifest file. Those empty lines are mandatory.

D> When compiled, a META-INF/MANIFEST.MF file will be automatically
generated with in the dist/SimpleBean_Project.jar file. The
META-INF/MANIFEST.MF will have the following content, identifying SimpleBean
as a JavaBean.

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 11.3-b02 (Sun Microsystems Inc.)
X-COMMENT: Main-Class will be added automatically by build

Name: com/simple/bean/practice/SimpleBean.class
Java-Bean: True

E> In the Projects window select SimpleBean_Project node and right click.
Choose Clean and Build Project from the context menu. The Project will be
built.

F> In the Files window expand SimpleBean_Project node. The distributable jar
file SimpleBean_Project.jar will be in the dist directory.

Hope that helps u ( If u haven't already found out all the above ). If u
have further questions, feel free to mail me.

--
View this message in context: http://www.nabble.com/Create-manifest%2C-jar-and-class-file-in-netbeans-tp18961040p23196254.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo