Q:

Android Studio keeps importing import sun.jvm.hotspot.utilities.IntArray

Every time I copy a piece of code in Java and paste it in my android studio, and it converts this code to Kotlin code, it keeps automatically importing this:
import sun.jvm.hotspot.utilities.IntArray

And every time android studio makes this import, it gives an error Unresolved reference: sun.
Does anyone know how to fix this?...it is very annoying.

A:

The only way I found, and it works so far, is disabling automatic import for specifically sun.* and com.sun.* packages. Just disabling sun.jvm.hotspot.utilities.IntArray caused Android Studio to select some other sun/com.sun packages to imports. Still not sure why, but here is where you can find the setting:

