Results 1 to 8 of 8
Thread: Executable Jar File Creation
- 11-11-2008, 04:07 PM #1
Member
- Join Date
- Oct 2008
- Posts
- 63
- Rep Power
- 0
Executable Jar File Creation
Hi, I am writing a Java application and I need help in creating an executable jar file(.jar) for my application. I have succeeded in creating a jar file using the command prompt by following instructions from other websites, but when I try to run it, It says "Java Virtual Machine Launcher could not find main class". Basically, all my .java and .class files are stored in a folder called 'Java123' . They are all seperate .java files e.g. it is not a project. Could this be a problem?
Help is greatly appreciated.
- 11-12-2008, 03:41 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
To create a jar file, no need to use *.java files, use *.class files of your project. Can you tell me which command you use to create that jar file on the command prompt?
- 11-12-2008, 06:55 AM #3
Member
- Join Date
- Jul 2008
- Posts
- 68
- Rep Power
- 0
my guess is that you haven't specified the Main-Class attribute in the jar's manifest
- 11-12-2008, 11:59 AM #4
Member
- Join Date
- Oct 2008
- Posts
- 63
- Rep Power
- 0
Jar File
I used the instructions at this website:
skylit.com/javamethods/faqs/createjar.html
- 11-12-2008, 03:14 PM #5
Member
- Join Date
- Jul 2008
- Posts
- 68
- Rep Power
- 0
Sun's Jar Tutorial
Read the warning under the section "Setting an application's entry point". I created a helloworld application and tried the steps from the link you listed and got the same error. After reading a bit on Sun's site I was able to get it to work correctly. Extract your jar and make sure the manifest has the Main-Class attribute.
- 11-12-2008, 04:14 PM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Off topic.
In most of the cases dealing with the Suns' tutorial is the best way to keen on Java. Everything you want is there.
- 11-12-2008, 04:55 PM #7
Member
- Join Date
- Nov 2008
- Posts
- 2
- Rep Power
- 0
Hi..
Hi All,
:)
I am newly joined in Java forum group.
:)
BR// Venkat
- 11-13-2008, 03:31 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
How to print the creation date of a jar file
By lunarbof in forum Advanced JavaReplies: 9Last Post: 08-22-2008, 06:12 PM -
Manifest file in executable jars
By Java Tip in forum Java TipReplies: 0Last Post: 12-15-2007, 08:16 PM -
Generate an executable file
By romina in forum New To JavaReplies: 1Last Post: 08-07-2007, 05:30 AM -
creation of new function
By an8086 in forum Advanced JavaReplies: 1Last Post: 07-16-2007, 02:20 PM -
An Introduction to Eclipse PDE - File Creation
By JavaForums in forum EclipseReplies: 0Last Post: 05-09-2007, 06:40 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks