?
Solved

Help needed to run a jar.

Posted on 2006-11-21
5
Medium Priority
?
307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 24

Assisted Solution

by:sciuriware
sciuriware earned 200 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 200 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

771 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