Solved

Help needed to run a jar.

Posted on 2006-11-21
5
292 Views
Last Modified: 2012-06-27
Hi All,

I have downloaded  a .jar that contains a manifest  and many .class files only. Attempting to run the jar, the error noted by javaw was that manifest does not have a valid construction, it actually lists no class file that  contains the word "main".

By doing a text search within the jar  for the word "main", I located a certain class file that has it. What suggestions are there to make this program run?
I have win2k and jdk1.5.0_05

I have opened and read the manifest as this:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: duns
Build-Jdk: 1.5.0_06
Extension-Name: freehep-psviewer
Specification-Title: Stand-alone and Embeddable PostScript Viewer
Specification-Vendor: FreeHEP
Implementation-Vendor: FreeHEP
Implementation-Title: freehep-psviewer
Implementation-Version: 2.0-SNAPSHOT


Upon attempting to run the jar :
The notice of failure reads:
Failed to load Main-Class manifest attribute from
freehep-psviewer-2.0-SNAPSHOT.jar

Delphi3
0
Comment
Question by:delphi3
  • 2
  • 2
5 Comments
 
LVL 24

Assisted Solution

by:sciuriware
sciuriware earned 50 total points
ID: 17993672
I think this is just a library to be called from your own program.
This is not a program: it has no main: no entrypoint.

;JOOP!
0
 
LVL 14

Accepted Solution

by:
hoomanv earned 50 total points
ID: 17994076
Simply because there is no Main-Class attribute in manifest file
If you know what is the main class, try running it like this
> java -cp path-to-jar main-class-path
0
 
LVL 4

Author Comment

by:delphi3
ID: 17996125
Hi

As noted in the manifest, since it was built using Build-Jdk: 1.5.0_06
is that a problem since I have jdk1.5.0_05?

 

Delphi3
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 17996975
No that can't be a problem.

;JOOP!
0
 
LVL 4

Author Comment

by:delphi3
ID: 18059831

Hi
I found a program in my files that will add a manifest to a jar.

It is a dead end for now, my need to know is not there any longer.

Closing Q.
D3

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now