title: Error "A JNI error has occurred. Please check your installation and try again in Eclipse x86 Windows 8.1"
body: <p>Consider:</p>
  <pre><code>public class LoginCumReg implements ActionListener, KeyListener {
  
      private JFrame form;
      private JTextField txtunm;
      private JTextField txtnm;
      private JTextField txteml;
      private JButton cmdcreate;
      private JPasswordField txtpass;
      private JPasswordField txtpassreg;
      private JButton cmdok;
      private JLabel lblunm;
      private JLabel lblpass;
      private JLabel lbleml;
      private JLabel lblpassreg;
      private JLabel lblnm;
      private JPanel panel_1;
  
      public LoginCumReg() {
          // Construct components
          form = new JFrame(&quot;Sign Up&quot;);
          form.getContentPane().setFont(
                  new Font(&quot;Plantagenet Cherokee&quot;, Font.BOLD, 18));
          txtunm = new JTextField(5);
          txtunm.addKeyListener(this);
          txtunm.setBounds(637, 55, 100, 25);
          txtnm = new JTextField(5);
          txtnm.setBounds(637, 228, 100, 25);
          txteml = new JTextField(5);
          txteml.setBounds(637, 264, 100, 25);
          cmdcreate = new JButton(&quot;Create Account&quot;);
          cmdcreate.setBounds(527, 350, 188, 25);
          txtpass = new JPasswordField(5);
          txtpass.setBounds(637, 91, 100, 25);
          txtpassreg = new JPasswordField(5);
          txtpassreg.setBounds(637, 300, 100, 25);
          cmdok = new JButton(&quot;OK&quot;);
          cmdok.setBounds(527, 139, 100, 25);
          lblunm = new JLabel(&quot;UserName&quot;);
          lblunm.setBounds(527, 55, 73, 25);
          lblpass = new JLabel(&quot;Password&quot;);
          lblpass.setBounds(527, 91, 100, 25);
          lbleml = new JLabel(&quot;Email ID&quot;);
          lbleml.setBounds(527, 264, 100, 25);
          lblpassreg = new JLabel(&quot;Password&quot;);
          lblpassreg.setBounds(527, 300, 100, 25);
          lblnm = new JLabel(&quot;Full Name&quot;);
          lblnm.setBounds(527, 228, 100, 25);
  
          // form.setResizable(false);
  
          // Adjust size and set layout
          form.setPreferredSize(new Dimension(800, 450));
  
          form.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          form.getContentPane().setLayout(null);
  
          // Add components
          form.getContentPane().add(txtunm);
          form.getContentPane().add(txtnm);
          form.getContentPane().add(txteml);
          form.getContentPane().add(cmdcreate);
          form.getContentPane().add(txtpass);
          form.getContentPane().add(txtpassreg);
          form.getContentPane().add(cmdok);
          form.getContentPane().add(lblunm);
          form.getContentPane().add(lblpass);
          form.getContentPane().add(lbleml);
          form.getContentPane().add(lblpassreg);
          form.getContentPane().add(lblnm);
  
          cmdcreate.setActionCommand(&quot;Create Account&quot;);
          cmdcreate.addActionListener(this);
          cmdok.setActionCommand(&quot;Login&quot;);
  
          JPanel panel = new JPanel();
          panel.setBounds(502, 29, 254, 154);
          panel.setFont(new Font(&quot;Palatino Linotype&quot;, Font.PLAIN, 14));
          panel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED,
                  null, null), &quot;LOGIN&quot;, TitledBorder.LEADING, TitledBorder.TOP,
                  null, null));
          panel.setBackground(SystemColor.controlHighlight);
          form.getContentPane().add(panel);
  
          panel_1 = new JPanel();
          panel_1.setBounds(500, 204, 254, 186);
          panel_1.setFont(new Font(&quot;Palatino Linotype&quot;, Font.PLAIN, 14));
          panel_1.setBorder(new TitledBorder(new EtchedBorder(
                  EtchedBorder.RAISED, null, null), &quot;SIGN UP&quot;,
                  TitledBorder.LEADING, TitledBorder.TOP, null, null));
          panel_1.setBackground(SystemColor.controlHighlight);
          form.getContentPane().add(panel_1);
  
          JLabel lblNewLabel = new JLabel(&quot;New label&quot;);
          lblNewLabel.setBounds(91, 139, 286, 101);
          lblNewLabel.setIcon(new ImageIcon(
                  &quot;C:\\Users\\JAsh\\Desktop\\Projects\\JAsh.png&quot;));
          form.getContentPane().add(lblNewLabel);
  
          JPanel panel_2 = new JPanel();
          panel_2.setBounds(77, 118, 315, 145);
          panel_2.setBorder(new EtchedBorder(EtchedBorder.RAISED,
                  SystemColor.activeCaptionBorder, SystemColor.menu));
          panel_2.setBackground(SystemColor.controlHighlight);
          form.getContentPane().add(panel_2);
          cmdok.addActionListener(this);
  
          form.setResizable(false);
          form.pack();
          form.setVisible(true);
          System.out.println(&quot;const..&quot;);
      }
  
      public static void main(String[] args) {
          new LoginCumReg();
      }
  
      @Override
      public void actionPerformed(ActionEvent ae) {
          // TODO Auto-generated method stub
  
          if (ae.getActionCommand().equals(&quot;Create Account&quot;)) {
              new Registration(txtnm.getText(), txteml.getText(), new String(
                      txtpassreg.getPassword()));
              form.setVisible(false);
          }
  
          if (ae.getActionCommand().equals(&quot;Login&quot;)) {
              try {
                  if (txtunm.getText().equalsIgnoreCase(&quot;admin&quot;)
                          &amp;&amp; new String(txtpass.getPassword()).equals(&quot;admin&quot;)) {
                      form.setVisible(false);
                      new Admin();
                  } else {
                      DataBase db = new DataBase();
                      db.connect();
                      String sql = &quot;SELECT * FROM LOGIN WHERE USERNAME='&quot;
                              + txtunm.getText() + &quot;'&quot;;
                      ResultSet rs = db.getDDL(sql);
                      boolean found = false;
                      while (rs.next()) {
                          if (rs.getString(&quot;Password&quot;).equals(
                                  new String(txtpass.getPassword()))) {
                              found = true;
                              form.setVisible(false);
                              String name = rs.getString(&quot;FullName&quot;);
                              Session.startSession(txtunm.getText(), name);
                              new FacultyWelcome();
                          }
                      }
                      if (!found)
                          JOptionPane.showMessageDialog(new JFrame(),
                                  &quot;Invalid Credentials&quot;);
                      db.close();
                  }
              }
              catch (Exception e) {
              }
          }
      }
  
      @Override
      public void keyPressed(KeyEvent arg0) {
          // TODO Auto-generated method stub
      }
  
      @Override
      public void keyReleased(KeyEvent arg0) {
          // TODO Auto-generated method stub
      }
  
      @Override
      public void keyTyped(KeyEvent arg0) {
  
          // TODO Auto-generated method stub
          // JOptionPane.showMessageDialog(new JFrame(), arg0.getKeyChar() + &quot;-&quot; + arg0.getKeyCode());
      }
  }
  </code></pre>
  <p>The above code works perfectly on my friend's laptop and throws this error on my laptop. I have running the code on <a href="https://en.wikipedia.org/wiki/Eclipse_%28software%29#Releases" rel="nofollow noreferrer">Eclipse v4.2</a> (Juno) using Java 7.</p>
  <p>I have also tested and run a lot of Java programs on my laptop all works well. This is the only program which gives such an error.</p>
  <p>How can I fix this problem?</p>