Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6834346

java.awt.Robot could not be instantiated with DISPLAY set to Linux machine

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      solaris

      Description

      If DISPLAY is exported to Linux machine, the following instantiation won't be possible on Solaris:

      public class Robot {
          public static void main(String[] args) throws java.awt.AWTException {
              new java.awt.Robot();
          }
      }

      On JDK7 it will lead to:

      Exception in thread "main" java.lang.IllegalArgumentException: button doesn't exist 12
              at java.awt.event.InputEvent.getMaskForButton(InputEvent.java:233)
              at java.awt.Robot.<init>(Robot.java:101)
              at Robot.main(Robot.java:3)

      Probably, other OS combinations are possible. Verified for two linix machines.

      Code sample above works fine on JDK6

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dbessono Dmitry Bessonov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: