JavaFX Fatal JRE Error (Oracle Java 8 91 Update)

I have been experiencing this strange problem for a while. I am making a JavaFX application that has a login screen.

The problem is that whenever I press the enter key after entering the username and password, I encounter the following fatal error. It works fine if I use the Login button.

# # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007efc4bf78948, pid=7213, tid=139620596950784 # # JRE version: Java(TM) SE Runtime Environment (8.0_91-b14) (build 1.8.0_91-b14) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.91-b14 mixed mode linux-amd64 compressed oops) # Problematic frame: # V [libjvm.so+0x6cf948] jni_invoke_nonstatic(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*)+0x38 # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # 

The full error log is here .

The following are the steps for the username and password fields that the ENTER key detects:

 fieldUsername.setOnKeyPressed((KeyEvent event) -> { if (event.getCode() == KeyCode.ENTER) { KeyEvent.fireEvent(buttonLogin, new MouseEvent(MouseEvent.MOUSE_CLICKED, 0, 0, 0, 0, MouseButton.PRIMARY, 1, true, true, true, true, true, true, true, true, true, true, null)); } }); fieldPassword.setOnKeyPressed((KeyEvent event) -> { if (event.getCode() == KeyCode.ENTER) { KeyEvent.fireEvent(buttonLogin, new MouseEvent(MouseEvent.MOUSE_CLICKED, 0, 0, 0, 0, MouseButton.PRIMARY, 1, true, true, true, true, true, true, true, true, true, true, null)); } }); 

I launch the login button each time I press the ENTER key.

And the following is the action listener for buttonLogin :

 buttonLogin.setOnMouseClicked((MouseEvent event) -> { CheckLoginAndPin c1 = new CheckLoginAndPin(); if (!fieldUsername.getText().isEmpty() && !fieldPassword.getText().isEmpty()) { if (c1.checkUsername(fieldUsername.getText())) { if (c1.login(fieldUsername.getText(), fieldPassword.getText())) { ArrayList<String> arrayListGetUserDetails = c1.getPriviledge(fieldUsername.getText()); stageLogin.close(); MainFrame mainFrame = new MainFrame(arrayListGetUserDetails.get(0), arrayListGetUserDetails.get(1), arrayListGetUserDetails.get(2), fieldUsername.getText()); } else { PopupErrorMessage popupErrorMessage = new PopupErrorMessage(stageLogin, "Password incorrect", fieldPassword, 100, 60); } } else { PopupErrorMessage popupErrorMessage = new PopupErrorMessage(stageLogin, "User name incorrect", fieldUsername, 100, 60); } } else { if (fieldUsername.getText().isEmpty() && !fieldPassword.getText().isEmpty()) { PopupErrorMessage popupErrorMessage = new PopupErrorMessage(stageLogin, "User name can not be empty", fieldUsername, 100, 60); } else if (fieldPassword.getText().isEmpty() && !fieldUsername.getText().isEmpty()) { PopupErrorMessage popupErrorMessage = new PopupErrorMessage(stageLogin, "Password can not be empty", fieldPassword, 100, 60); } else if (fieldUsername.getText().isEmpty() && fieldPassword.getText().isEmpty()) { PopupErrorMessage popupErrorMessage = new PopupErrorMessage(stageLogin, "User name & password can not be empty", fieldUsername, 100, 60); } } }); 

JDK - Oracle Java 8 Update 91
OS - Ubuntu 16.04 LTS 64-bit
IDE - Netbeans IDE 8.0.2

What am I doing wrong here?

+6
source share

All Articles