简体   繁体   English

在进行Eclipse和Android项目时出现问题

[英]Issues with Eclipse while working on and Android project

I am currently developing an application with my software engineering classmates. 我目前正在与我的软件工程同学一起开发一个应用程序。 I am experiencing a few issues with Eclipse, however. 但是,我在Eclipse中遇到一些问题。 But first, some information about my Eclipse: I am running version: Juno Service Release 2 with a build id of 20130225-0426. 但是首先,有关Eclipse的一些信息:我正在运行版本:Juno Service Release 2,其构建ID为20130225-0426。 I am running Eclipse on my MacBook with OS X Mountain Lion 10.7.5. 我在装有OS X Mountain Lion 10.7.5的MacBook上运行Eclipse。 I am using SVN to upload and download the project to a repository through assembla.com. 我正在使用SVN通过assembla.com将项目上载并下载到资源库。

First, Eclipse will not recognize any errors. 首先,Eclipse将无法识别任何错误。 If I purposely type random characters, Eclipse does not underline them with red. 如果我有意输入随机字符,则Eclipse不会用红色下划线。

Next, whenever I type "this.whatever" or "@ for javadoc" I receive the following message: "this compilation unit is not on the build path of a Java project." 接下来,无论何时键入“ this.whatever”或“ @ for javadoc”,我都会收到以下消息:“此编译单元不在Java项目的构建路径上。” I can click "OK" and continue with no problem though. 我可以单击“确定”,然后继续进行。

Finally, whenever I attempt to run the program I receive this message:"The selection cannot be launched, and there are no recent launches." 最后,每当我尝试运行该程序时,我都会收到以下消息:“无法启动选择,并且没有最近的启动。”

Other notes: I do not have any of these issues with any of my other projects in my workspace. 其他说明:我的工作区中的任何其他项目都没有这些问题。 I also have another project using the assembla repository that does not contain these issues. 我还有一个使用assembla存储库的项目,其中不包含这些问题。 These issues just occurred all of the sudden. 这些问题突然发生了。

Edit: None of the other members in my group are experiencing these issues. 编辑:我组中的其他成员都没有遇到这些问题。 I have attempted to download the project from the repository on a different machine and I still have these problems. 我试图从另一台计算机上的存储库下载项目,但仍然遇到这些问题。 I have attempted to delete the project from my workspace and re-download. 我试图从工作区中删除项目并重新下载。 Still a no go. 还是不行。

Update: I even installed the Android Development Kit and used the included copy of Eclipse. 更新:我什至安装了Android Development Kit并使用了随附的Eclipse副本。 It will still not work properly. 它仍然无法正常工作。

What is going on with my Eclipse? 我的Eclipse发生了什么?

Since I guess you're in start phase of android coding and you're not addicted to a special IDE, I strongly recommend the IntelliJ IDEA instead of Eclipse for Android development. 由于我猜您正处于android编码的开始阶段,并且您没有沉迷于特殊的IDE,因此我强烈建议您使用IntelliJ IDEA而非Eclipse进行Android开发。 I have tried Eclipse already and because of its weaknesses, now I'm using IntelliJ . 我已经尝试了Eclipse并且由于它的弱点,现在我正在使用IntelliJ Eclipse is not the best IDE for Android development and have a long way to become the one. Eclipse并不是用于Android开发的最佳IDE,并且要成为一个开发者还有很长的路要走。

IntelliJ IDEA IntelliJ IDEA

I suggest you try installing the ADT bundle in a new location and see if you still have these problems. 建议您尝试在新位置安装ADT捆绑包 ,看看是否仍然存在这些问题。 The ADT bundle includes the latest Android SDK along with a version of Eclipse with the ADT (the Android Developer Tools plugin) already installed and configured. ADT软件包包括最新的Android SDK,以及已安装和配置了ADT(Android开发人员工具插件)的Eclipse版本。 It's possible that you have (or have had in the past) other Eclipse plugins that affect how the Java tools in Eclipse work, possibly in a way that interferes with ADT. 您可能(或曾经有过)其他Eclipse插件会影响Eclipse中的Java工具的工作方式,并且可能会干扰ADT。 I have personally had problems like this in the past with tools like Aptana, where even after uninstalling there would be problems. 我过去曾经通过Aptana之类的工具遇到过这样的问题,即使在卸载后也会出现问题。

Eclipse is telling you already with the above error message: You don't have your sources on a build path, but just in some folder. Eclipse已经用上面的错误消息告诉您:您的源代码不在构建路径上,而仅在某个文件夹中。

Either you have created a simple project instead of a Java project, which then also doesn't do anything Java specific. 您已经创建了一个简单的项目而不是Java项目,该项目也没有执行任何Java特定的任务。 Or you have created your Java files in plain folders, instead of source folders. 或者,您在普通文件夹而不是源文件夹中创建了Java文件。

The best way to sort this out is to create a new Java project using the Eclipse "New..." wizard from the main menu. 最好的解决方法是使用主菜单中的Eclipse“ New ...”向导创建一个新的Java项目 Compare the result of that to your project. 将结果与您的项目进行比较。 The two important things are: The project has an icon with a small "J" overlayed. 重要的两件事是:该项目的图标上有一个小“ J”。 The Java sources are shown in packages, which themself are in source folders (with a package overlay), not in simple folders. Java源代码显示在包中,它们本身在源文件夹中(带有程序包覆盖),而不是在简单文件夹中。

在此处输入图片说明

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

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