如果你手工配置build path,把SDK1.5的android.jar加入到某些工程中,你可能会遇到下面的编译错误:


> Attempt to include a core VM class in something other than a core
> library.
> It is likely that you have attempted to include the core library from
> a desktop
> virtual machine into an application, which will most assuredly not
> work. If
> you really intend to build a core library -- which is only appropriate
> as
> part of creating a full virtual machine binary, as opposed to
> compiling an
> application -- then use the "--core-library" option to suppress this
> error
> message. If you go ahead and use "--core-library" but are in fact
> building
> an application, then please be aware that your build will still fail
> at some
> point; you will simply be denied the pleasure of reading this helpful
> error
> message.
>

 

这意味着你想把一个桌面VM中的类运用到android应用程序中,比如java.awt.*, java.swing.*, java.bean等。

可用android包参见:available packages on Android,这肯定是不行的。

 

为了解决这个问题,需要修改工程目录下的.classpath文件,把其中的path设置成下面的值即可:

path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>

更多相关文章

  1. Android工程获取bulid.xml文件的方法
  2. android 使用反射机制获取工程中的图片
  3. Android高级工程师必备知识点--更新中
  4. IDEA 13 编译android工程出现java.nio.BufferOverflowException
  5. Android 技术目标:全栈工程师
  6. android工程下不能运行java main程序的解决办法
  7. Android之路——走进Android(工程结构剖析)
  8. Android学习路线:如何成长为高级工程师

随机推荐

  1. 如何画出男性头像?初学绘画动画人物脸部入
  2. C++实现图书管理系统课程设计
  3. C++实现单词管理系统
  4. 如何使用IDEA查看java文件编译后的字节码
  5. 关于@Query注解的用法(Spring Data JPA)
  6. C++实现图书管理系统(文件操作与类)
  7. 老街腾龙娱乐17649117476
  8. JPA @Query时,无法使用limit函数的问题及
  9. 玉祥公司客服17649117476
  10. SpringBoot JPA出现错误:No identifier s