• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Finding main class problem

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

I have a set of files in a package called samspackage in a project called Application. This contains a class file with the main method in it called Program

I have set the main class as samspackage.Program

However, when I try to double click on the jar file Application.jar, found in the dist folder of the project's home directory Application, I get the following message:

Could not find the main class. Program will exit.

I can not see why this is so because my manifest file looks like this:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.)
Main-Class: snpviewerpackage.Program
Class-Path: lib/JavaClient lib/swing-layout-1.0.jar
X-COMMENT: Main-Class will be added automatically by build


with two blank lines underneath the last line.

Any ideas?

Thanks
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So if you say "jar tf Application.jar", do you see a line like

samspackage/Program.class
 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
amongst others yes.

In addition, I have other Program classes:

samspackage/Program$1.class
samspackage/Program$2.class
samspackage/Program$3.class
samspackage/Program$4.class
samspackage/Program$5.class
samspackage/Program$6.class
samspackage/Program$7.class
[ July 19, 2007: Message edited by: Sam Bluesman ]
 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ernest.

I've figured it out. I had a package placed where it should not have been.

All works fine.

Thanks.
 
Friends help you move. Good friends help you move bodies. This tiny ad will help:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic