I’m encountering an error “A JNI error has occurred. Please check your installation and try again” when running a Java program in Eclipse on my Windows 8.1 x86 machine. The program, which includes GUI components and database interactions, runs fine on my friend’s laptop.
Here is a simplified version of the Java program that reproduces the error:
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() {
// GUI initialization code
// ...
}
public static void main(String[] args) {
new LoginCumReg();
}
// ActionListener and KeyListener implementations
// ...
// Database interaction code
// ...
}
The error occurs only on my laptop, even though I’ve successfully run other Java programs on it. How can I resolve this issue?