Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Ant supplies docs but its jar fails

 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi
My build file as well as the output using ant are indicated below

Though the jar file is created with sucess as also the whole docs have been built  
What more i used the manifest attribute to include Main-Class even then the  jar  is not working  on dounle click
Please correct me in build file stage ref the manifest details also shown
Thanks
As
CRMK



 
Sheriff
Posts: 22506
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First you need to find out why double clicking the JAR fails, and you need to go command line for that. Please try executing java -jar Project.jar, and list its output here.
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:First you need to find out why double clicking the JAR fails, and you need to go command line for that. Please try executing java -jar Project.jar, and list its output here.


Hi


Thanks  for your immediate clarity
The results are as under

*************************
C:\Program Files\java\jdk1.8.0_101\bin>java -jar Project.jar
Error: Could not find or load main class src.Project
*************************
Contexually  looking at the manifest details dumped by ant you may suggeset remedial  measure as beta stuff may be the cause Pleases indicate a new manifest  with relevent ones using the same ant that is already exists

Thanks

As
CRMK
 
Rob Spoor
Sheriff
Posts: 22506
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Comal Rajagopalaratnam Muthukumar wrote:Error: Could not find or load main class src.Project


1) Is your class in a package named src?
2) In your JAR file, is file Project.class inside a folder called src which in turn is located at the root of the JAR? Please execute jar -tf Project.jar and list the output here.
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:

Comal Rajagopalaratnam Muthukumar wrote:Error: Could not find or load main class src.Project


1) Is your class in a package named src?
2) In your JAR file, is file Project.class inside a folder called src which in turn is located at the root of the JAR? Please execute jar -tf Project.jar and list the output here.




Hi

The following buildfile which now not only supplies docs but also creates a jar file that is double clickable
has the MANIFEST.MF (This is for a Java Application Prg)Please note that java program is without package to start with
which is an an alternative to earlier manifest.txt that used to contain main class
This is obtained after trails
For your perusal please
Thanks
As
CRMK


 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic