I tried to take screenshot using java Robot class with NetBeans, as it is shown below

    try {
Rectangle screen = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
BufferedImage capture  = new Robot().createScreenCapture(screen);

ImageIcon icon = new ImageIcon(capture);

}catch(Exception  ex){
JOptionPane.showMessageDialog(null, ex);

and I got this error

A fatal error has been detected by the Java Runtime Environment: SIGSEGV (0xb) at pc=0x00007f58931331d8, pid=3254, tid=0x00007f5890750700 JRE version: Java(TM) SE Runtime Environment (8.0_171-b11) (build 1.8.0_171-b11) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode linux-amd64 compressed oops) Problematic frame: C [libawt_xawt.so+0x421d8] ReadRegionsInList+0x3b8 Core dump written. Default location: /home/sanaa/Desktop/server/RobotExample/core or core.3254

any idea what is causing the error ?

Note: I used the same code in windows-32bits /Netbeans and it works

1 Answer 1


Looks like you hit a segmentation fault in your Java Runtime:

I can't tell you exactly what you're problem is but I can tell you that somehow, the JRE tried to access, allocate, or deallocate memory that didn't belong to it as explained in the official documentation.

Start off by making sure that you have the latest version of the JRE, and that it is the correct one for your OS (also make sure 32 v 64 bit is correct).

If you can reliably reproduce the issue and it's on the latest version of the JRE that is correctly installed, I suggest that you raise an official bug report with Oracle.

  • 1
    Welcome to Ask Ubuntu ;-) Could you please edit your answer and clarify it a bit like where to download the latest JRE? Also please review my edits to improve the readability of your answers in the future. 0:-)
    – Fabby
    Jun 18, 2019 at 22:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .