[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

Help needed to run a jar.

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
delphi3
Asked:
delphi3
  • 2
  • 2
2 Solutions
 
sciuriwareCommented:
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
 
hoomanvCommented:
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
 
delphi3Author Commented:
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
 
sciuriwareCommented:
No that can't be a problem.

;JOOP!
0
 
delphi3Author Commented:

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now