Ask Experts Questions for FREE Help !
Ask
    ubharedev's Avatar
    ubharedev Posts: 134, Reputation: 1
    Junior Member
     
    #1

    Oct 5, 2010, 02:32 AM
    To create jar file in java
    Hi,
    I want to create an executable file for my console application program.
    It is a network file sharing program, need to run on double click or command line.
    This program contains 11 class files in which FileSharing.class is the main class file.
    I have created manifest.txt file with 'Class-Path: Test1/FileSharing.class' as main class file where Test1 is the package.

    Then I run the command: jar cfm FileShare.jar manifest.txt *.class
    I creates a jar file with FileShare.jar name.
    But while giving the run command from cmd.
    java -jar FileShare.jar or java -jar FileShare
    Gives the following error:
    Unrecognized option: -
    Could not create the Java virtual machine.

    Please help.

    Regards,
    Dev
    ubharedev's Avatar
    ubharedev Posts: 134, Reputation: 1
    Junior Member
     
    #2

    Oct 8, 2010, 02:05 AM
    Ok.
    I got the answer.
    Go to the folder where u put all class files in command prompt.
    Create manifest file.
    Type in command prompt: jar cfm jarfilename.jar manifestfilename.txt *.class
    Finish.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search


Check out some similar questions!

Create a link in a pdf file for open an Excel file in an specific sheet and cell [ 2 Answers ]

I know how to create a hyperlink in a pdf file that opens an Excel file but I don't know how this link can opens the Excel file in a specific sheet and cell; any ideas?

How to create a swf file [ 1 Answers ]

How do I create a swf file?

To create pdf file [ 4 Answers ]

How can I convert a book to pdf file?

Windows XP missing Jar File [ 1 Answers ]

Whenever I try to download certain software, and it starts to install the software, I get a window that says, "Unable to install due to Virtual Machine Launcer, missing Jar File".


View more questions Search