Solved

Manifest Attribute Problem in JAR file

Posted on 2009-05-19
1
357 Views
Last Modified: 2013-12-29
I have a source and corresponding  .class file in c:\temp\temp\temp

Tried to make a jar file out of the class file. It does make one but is not runnable using java -jar jarfile.jar command. I keep getting the error:

Failed to load Main-Class manifest attribute from class1.jar

What I have now done is that I created the jar file with the default manifest file. I also know the file must be ended with a newline, the last line should be blank etc.
However, I think I am failing at how to include information about the Main-Class attribute.

So, to keep things simple, I attached the default manifest file. Please guide me what and how to edit in that file so that I can run that jar from command line.

Thanks
1).Code for class1.java file in c:\temp\temp\temp
 
package temp.temp.temp;
public class class1{
public static void main(String[] args)
{    System.out.println("Hi");  }
}
 
2).Code for MANIFEST.MF:
 
Manifest-Version: 1.0
Created-By: 1.5.0_18 (Sun Microsystems Inc.)
 
Thanks
 
Roopesh

Open in new window

0
Comment
Question by:perfect_tranquility
[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
1 Comment
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 24427401
add:


Main-Class: temp.temp.temp.class1


0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven module vs maven project 3 73
Adding multiple JVM environments to RedHat 6 7 69
Html Table Looping (part 2) 5 34
glassfish admin console 1 20
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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.

762 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