File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Nikhil Sagar
Ranch Hand
Posts: 216
Java Linux Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nikhil Sagar
Ranch Hand
Posts: 216
Java Linux Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 216
Java Linux Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jeff...
sherrif....
help me......
where are you guys ???
 
Sumit Patil
Ranch Hand
Posts: 296
Eclipse IDE Firefox Browser Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nikhil Sagar wrote:jeff...
sherrif....
help me......
where are you guys ???

I was busy. Please read this.
 
Stanley Mungai
Ranch Hand
Posts: 155
Java Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic