• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Ant supplies docs but its jar fails

 
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • 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: 21972
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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: 374
  • Mark post as helpful
  • send pies
  • 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: 21972
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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: 374
  • Mark post as helpful
  • send pies
  • 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


 
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold 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
    Bookmark Topic Watch Topic
  • New Topic