title: JAR file Main class not found and java.io.fileNotFoundException
body: <pre><code>public class myapp extends Frame {
  
      public static void main(String args[]) {
          myapp mdi = new myapp();
      }
  
      static void Fatal(String s) {
          MessageBox mb = new MessageBox("JMF Error", s);
      }
  
      JMFrame jmframe = null;
      JDesktopPane desktop;
      FileDialog fd = null;
      CheckboxMenuItem AutoLoop = null;
      Player player = null;
      Player newPlayer = null;
      String filename;
  
      public myapp() {
          super("Java Media Player");
  
          // Add the desktop pane
          setLayout(new BorderLayout());
          desktop = new JDesktopPane();
          desktop.setDoubleBuffered(true);
          add("Center", desktop);
          setMenuBar(createMenuBar());
  
          setSize(640, 480);
          setVisible(true);
  
          addWindowListener(new WindowAdapter() {
              public void windowClosing(WindowEvent we) {
                  System.exit(0);
              }
          });
  
      }
  
      private MenuBar createMenuBar() {
          ActionListener al = new ActionListener() {
              public void actionPerformed(ActionEvent ae) {
                  String command = ae.getActionCommand();
                  if (command.equals("Open")) {
                      if (fd == null) {
                          fd = new FileDialog(myapp.this, "Open File",
                                  FileDialog.LOAD);
                      }
                      fd.show();
                      if (fd.getFile() != null) {
                          String filename = fd.getDirectory() + fd.getFile();
                          openFile("file:" + filename);
                      }
                  } else if (command.equals("Exit")) {
                      dispose();
                      System.exit(0);
                  }
              }
          };
  
          MenuItem item;
          MenuBar mb = new MenuBar();
  
          Menu mnFile = new Menu("File");
          item = new MenuItem("Open");
          mnFile.add(item);
          item.addActionListener(al);
          mnFile.add(item = new MenuItem("Exit"));
          item.addActionListener(al);
  
          // Options Menu
          Menu mnOptions = new Menu("Options");
          AutoLoop = new CheckboxMenuItem("Auto replay");
          AutoLoop.setState(true);
          mnOptions.add(AutoLoop);
  
          Menu mn = new Menu("Help");
          MenuItem ball = new MenuItem("Build");
          ball.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                  JOptionPane.showMessageDialog(myapp.this,
                          "DEVELOPED BY DVM XLADOR");
              }
          });
          mn.add(ball);
          mb.add(mn);
          mb.add(mnFile);
          mb.add(mnOptions);
          mb.add(mn);
          return mb;
      }
  
      /**
       * Open a media file.
       */
      public void openFile(String filename) {
          String mediaFile = filename;
          Player player = null;
          // URL for our media file
          URL url = null;
          try {
              // Create an url from the file name and the url to the
              // document containing this applet.
              if ((url = new URL(mediaFile)) == null) {
                  Fatal("Can't build URL for " + mediaFile);
                  return;
              }
  
              // Create an instance of a player for this media
              try {
                  player = Manager.createPlayer(url);
              } catch (NoPlayerException e) {
                  Fatal("Error: " + e);
              }
          } catch (MalformedURLException e) {
              Fatal("Error:" + e);
          } catch (IOException e) {
              Fatal("Error:" + e);
          }
          if (player != null) {
              this.filename = filename;
              JMFrame jmframe = new JMFrame(player, filename);
              desktop.add(jmframe);
          }
      }
  }
  
  class JMFrame extends JInternalFrame implements ControllerListener {
      Player mplayer;
      Component visual = null;
      Component control = null;
      int videoWidth = 0;
      int videoHeight = 0;
      int controlHeight = 30;
      int insetWidth = 10;
      int insetHeight = 30;
      boolean firstTime = true;
  
      public JMFrame(Player player, String title) {
          super(title, true, true, true, true);
          getContentPane().setLayout(new BorderLayout());
          setSize(320, 10);
          setLocation(50, 50);
          setVisible(true);
          mplayer = player;
          mplayer.addControllerListener((ControllerListener) this);
          mplayer.realize();
          addInternalFrameListener(new InternalFrameAdapter() {
              public void internalFrameClosing(InternalFrameEvent ife) {
                  mplayer.close();
              }
          });
  
      }
  
      public void controllerUpdate(ControllerEvent ce) {
          if (ce instanceof RealizeCompleteEvent) {
              mplayer.prefetch();
          } else if (ce instanceof PrefetchCompleteEvent) {
              if (visual != null)
                  return;
  
              if ((visual = mplayer.getVisualComponent()) != null) {
                  Dimension size = visual.getPreferredSize();
                  videoWidth = size.width;
                  videoHeight = size.height;
                  getContentPane().add("Center", visual);
              } else
                  videoWidth = 320;
              if ((control = mplayer.getControlPanelComponent()) != null) {
                  controlHeight = control.getPreferredSize().height;
                  getContentPane().add("South", control);
              }
              setSize(videoWidth + insetWidth, videoHeight + controlHeight
                      + insetHeight);
              validate();
              mplayer.start();
          } else if (ce instanceof EndOfMediaEvent) {
              mplayer.setMediaTime(new Time(0));
              mplayer.start();
          }
      }
  }
  </code></pre>
  
  <p></p>
  
  <pre><code>D:\hadoop&gt;jar cvf db.jar *.class
               added manifest
            adding: JMFrame$1.class(in = 600) (out= 377)(deflated 37%)
          adding: JMFrame.class(in = 2362) (out= 1329)(deflated 43%) 
              adding: myapp$1.class(in = 469) (out= 334)(deflated 28%)
              adding: myapp$2.class(in = 1330) (out= 807)(deflated 39%)
            adding: myapp$3.class(in = 631) (out= 436)(deflated 30%)
        adding: myapp.class(in = 3283) (out= 1787)(deflated 45%)
  
  D:\hadoop&gt;java -jar db.jar
    no main manifest attribute, in db.jar
  </code></pre>
  
  <hr>
  
  <p>I can compile my file with no issues but when it comes to creation of jar file it notifies me error of java.io.FileNotFoundException jni error please check your installation and also about manife.st file. Just correct my the segment of code where I made a mistake</p>