我想出了如何在桌面上获得我想要的效果。
(窗口 > 首选项 > Java > 安装的 JRE > jre7 [编辑] > [添加外部 JAR])
但我无法在 android 上获得相同的效果。
在桌面项目中,我可以看到文件夹“JRE System Library(jre7)”包含我引用的所有 JAR
此目录不存在于 android 项目中。 如何添加库以自动包含在 Android 项目中,而无需使用“R-Click Project > Properties > Java Build Path > Libraries”方法或“R-Click JAR file > Build Path > Add to IDE“Eclipse”中的“构建路径”方法
最佳答案
In the desktop project i can see the folder "JRE Sysytem Library(jre7)" contains all the JARs i referenced
Android 应用不使用 JRE。
How do I add libraries to be automatically included in an Android project without needing to use the "R-Click Project > Properties > Java Build Path > Libraries" method OR the "R-Click JAR file > Build Path > Add to build path" method in the IDE "Eclipse"
抱歉,这是不可能的。 Android 不使用 Eclipse 的“添加外部 JAR”,无论它是手动填充还是自动填充。它仅使用 libs/
或附加的 Android 库项目中的 JAR。
关于java - 在项目创建时自动加载库。安卓、 eclipse ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20861752/