am try to create a simple jar file... i got some error to run that jar file

error =" Failed to load Main-Class manifest attribute from

my code:

import javax.swing.JOptionPane;

public class hello{

public static void main(String args[]){

String s= JOptionPane.showInputDialog("enter name plz....");

JOptionPane.showMessageDialog(null,"hello "+s);



here am attached that source file and jar file...

jar file here..

Recommended Answers

All 2 Replies

What is the jar command you used and did you make a manifest file?

jar -cf bala.jar hello.class

and then manually edit the jar (meta inf MANIFEST file add main class (Main-Class:hello and save the file and update the zip)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.