Solved

Help needed to run a jar.

Posted on 2006-11-21
5
289 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

744 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

16 Experts available now in Live!

Get 1:1 Help Now