Solved

Manifest Attribute Problem in JAR file

Posted on 2009-05-19
1
359 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

623 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