File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes  how to open run jar file with double click in windows 7 ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark " how to open run jar file with double click in windows 7 ?" Watch " how to open run jar file with double click in windows 7 ?" New topic
Author

how to open run jar file with double click in windows 7 ?

Nikhil Sagar
Ranch Hand

Joined: Apr 21, 2012
Posts: 216

i am able to run this from command prompt but whenever i try to run it with double click it says could not find the main class. program will exit.


OCPJP 6 86%
Nikhil Sagar
Ranch Hand

Joined: Apr 21, 2012
Posts: 216

i am able to run it by
1.java -jar myprog.jar
2.javaw -jar myprog.jar
but when i try to do
javaw myprog.jar
it says could not find main-class
help me please
Nikhil Sagar
Ranch Hand

Joined: Apr 21, 2012
Posts: 216

jeff...
sherrif....
help me......
where are you guys ???
Sumit Patil
Ranch Hand

Joined: May 25, 2009
Posts: 296

You need to modify the MANIFEST.MF file present in the META-INF directory and give the name of the class containing the main method.
Check this tutorial


Thanks & Regards, Sumeet
SCJP 1.4, SCWCD 5, LinkedIn Profile
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40064
    
  28
Nikhil Sagar wrote:jeff...
sherrif....
help me......
where are you guys ???

I was busy. Please read this.
Stanley Mungai
Ranch Hand

Joined: Dec 09, 2011
Posts: 155

Alternatively, You can Run it using a .bat file. Type in a notepad:



The save as all files with a .bat extension in the same folder as the .jar file. Then double click the .bat file......Just a thought


Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to open run jar file with double click in windows 7 ?