Unable to load system cursor: CopyDrop.32x32 exception in Java on Centos 7

I installed netbeans 8.2 on Centos 7.

I get this error:

java.lang.RuntimeException: failed to load system cursor: DnD.Cursor.CopyDrop : cannot load system cursor: CopyDrop.32x32
    at java.awt.dnd.DragSource.load(DragSource.java:135)
    at java.awt.dnd.DragSource.<clinit>(DragSource.java:148)

Java version:

openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)

How can i fix this?

+4
source share
5 answers

I have found a solution.

1- Edit the following file:

nano /etc/default/grub 

2- Replace rhgb quietwith nomodeset.

3- Launch on the terminal grub2-mkconfig -o /boot/grub2/grub.cfg

4- Reboot.

In fact, this does not solve the problem. He ignores it.

+1
source

It seems the error has been resolved using java 8u152 b05. The following code passes 8u152, but throws the specified exception using Java 8u131:

public static void main(String[] args) {
    DragSource.getDefaultDragSource(); 
}

8u152 "JDK 8 Updates Early-Access Builds": http://jdk.java.net/8/

+4

Kali virtualbox.

, solotion .

" 3D-" "" → "" → "".

!

+3

: 257554 - RuntimeException: : DnD.Cursor.CopyDrop: : CopyDrop.32x32

, ​​Unity-Mir: Java- X11 - XQueryBestCursor 0,0.

, JDK- XMir ( ) . , XMir.

Java, Xorg . , . X () , .

Java, XMir...

XMir 1.0 ( Xorg) . "Xmir" ( 'xmir'), Ubuntu 15.10 .

. Xmir (, ). , , ( Android Mir).

You should consider upgrading to the new version.

+1
source

My Java code uses Drag & Drop in JTree, which is interrupted after upgrading from CentOS 6 to CentOS 7. Same hardware, same OpenJDK, same Java code, but different graphics driver. A workaround with setting up the command line kernel "nomodeset" helps, but leads to poor graphics and flicker. Here is an easy way to get around Java:

  //workaround for used Drag&Drop cursors which are unsupported by graphics driver
  public static void initUnsupportedCursors() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException
  {
    String cursors[] = new String[]{
        "DnD.Cursor.CopyDrop",
        "DnD.Cursor.MoveDrop",
        "DnD.Cursor.LinkDrop",
        "DnD.Cursor.CopyNoDrop",
        "DnD.Cursor.MoveNoDrop",
        "DnD.Cursor.LinkNoDrop"
        };
   List <String> unsupportedCursors =  new ArrayList <String>(); 
   for (String c : cursors)
   {
     try
     {
       if (Toolkit.getDefaultToolkit().getDesktopProperty(c) == null)
       {
         throw new Exception("Can't find cursor " + c);
       }
     }
     catch (Exception e)
     {
       unsupportedCursors.add(c);
     }
   }
   if (!unsupportedCursors.isEmpty())
   {
     Field propsFiled = Toolkit.class.getDeclaredField("desktopProperties");
     propsFiled.setAccessible(true);
     Map props = (Map) propsFiled.get(Toolkit.getDefaultToolkit());
     for (String unsupportedCursor : unsupportedCursors)
     {
       System.out.println("Replacing unsupported " + unsupportedCursor + " by " + Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
       props.put(unsupportedCursor, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
     }
   }
  }
+1
source

Source: https://habr.com/ru/post/1666267/


All Articles