Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-19-2008, 12:31 AM
Member
 
Join Date: Oct 2007
Posts: 11
po0oker is on a distinguished road
creating jar file
hi

i would like to create an executable jar file that runs by double clicking ..

could someone please explain it step by step


thank you in advance
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-19-2008, 04:47 AM
Member
 
Join Date: Oct 2007
Posts: 11
po0oker is on a distinguished road
ok i have managed to create the jar file but i am getting an error message

""could not find the main class . program exit ""

anyone can help !!
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-25-2008, 07:42 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,412
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Are you working on any IDE? Most of the IDE create a jar file of your project.

How did you create that jar file? Seems to me that you don't have included manifest.mf or, that file is failed to link your main class
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by Eranga : 03-25-2008 at 07:44 AM. Reason: adding more...
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-04-2008, 09:49 PM
Member
 
Join Date: Feb 2008
Posts: 45
new_2_java is on a distinguished road
Here's what you need to do:

1. You should have a Manifest.mf file, which will contain the following lines.

I am using HelloWorld.java as example.

Code:
Main-Class: your.package.HelloWorld
NOTE: Make sure you hit ENTER at the end of the line (Manifest.mf file).

2. Next create your jar file, as follow:
Code:
>jar cmf Manifest.mf hello.jar *.*
That's it. You can run it by double clicking on it and or as follow:

Code:
>java -jar hello.jar

Last edited by new_2_java : 04-04-2008 at 09:53 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem creating a Post script file krishnan.1000 New To Java 0 02-14-2008 09:15 PM
Creating a File object in Servlet Java Tip Java Tips 0 01-16-2008 12:24 PM
creating .ear file psn Enterprise JavaBeans 1 01-06-2008 07:01 AM
File creating date/time bugger New To Java 1 11-11-2007 09:43 PM
Creating jar file Heather Advanced Java 2 07-08-2007 03:17 PM


All times are GMT +3. The time now is 11:17 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org