简体   繁体   English

导入太阳无法解决

[英]The import sun cannot be resolved

I have a little problem while compiling an Android application with Eclipse. 使用Eclipse编译Android应用程序时遇到了一些问题。

It says : 它说 :

The import sun cannot be resolved

Actually I want to use the NotImplementedException Class from the package 实际上我想从包中使用NotImplementedException

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. 我安装了Java 1.7和用于Java EE开发人员的Eclipse Indigo IDE。

The classes in sun.* are not meant to be imported . sun.*中的类不是要导入的 They are for internal use of the JVM only. 它们仅供JVM内部使用。

Use UnsupportedOperationException instead of NotImplementedException . 使用UnsupportedOperationException而不是NotImplementedException

The sun.* packages are not part of the JDK but rather implementations in the Oracle JVM. sun.*包不是JDK的一部分,而是Oracle JVM中的实现。 As you are developing for Android (the dalvik JVM), those packages are not available. 在您开发Android(dalvik JVM)时,这些软件包不可用。 Simple as that. 就那么简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM