4

I have a little problem while compiling an Android application with Eclipse.

It says :

The import sun cannot be resolved

Actually I want to use the NotImplementedException Class from the package

sun.reflect.generics.reflectiveObjects

Do you have any ideas where it come from ?

I have Java 1.7 installed and Eclipse Indigo IDE for Java EE Developers.

EdRbt
  • 329
  • 1
  • 6
  • 17

2 Answers2

7

The classes in sun.* are not meant to be imported. They are for internal use of the JVM only.

Use UnsupportedOperationException instead of NotImplementedException.

3

The sun.* packages are not part of the JDK but rather implementations in the Oracle JVM. As you are developing for Android (the dalvik JVM), those packages are not available. Simple as that.

pap
  • 27,064
  • 6
  • 41
  • 46