Java Eclipse 上运行配置中的项目选择为空

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20031336/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 22:29:45  来源:igfitidea点击:

Project Selection in Run Configurations on Eclipse is Empty

javaandroideclipse

提问by myooomyoo

I'm a newbie in Android Development. And I have this one tini-tiny problem which I'm not able to fix it. Every time I run configurations, and browse the Project name, the Project selection is empty and I cant click on any on it except the "Cancel" Button. Then I can't really launch my project. How does one fix this?

我是 Android 开发的新手。我有一个我无法解决的小问题。每次我运行配置并浏览项目名称时,项目选择都是空的,除了“取消”按钮之外,我无法点击它。然后我无法真正启动我的项目。如何解决这个问题?

采纳答案by mrres1

In the Java Perspective choose the Runmenu and go to Run Configurations

在 Java Perspective 中选择Run菜单并转到Run Configurations

Select the item in the list titled "Android Application" and press the plus/add button.

在标题为“Android 应用程序”的列表中选择项目,然后按加号/添加按钮。

On the next page, choose the Browsebutton and choose the Android App that you'd like to run.

在下一页上,选择Browse按钮并选择您要运行的 Android 应用程序。

image description here

图片说明在这里

enter image description here

在此处输入图片说明

回答by mrres1

Right click on your package in the Package Explorer, click Properties, and see if you're using any libraries. Make sure that the "Is Library" box is not ticked on your project.

在包资源管理器中右键单击您的包,单击属性,然后查看您是否正在使用任何库。确保您的项目上没有勾选“是库”框。

回答by Benno

I had the same problem and found I hadn't put the project name in Project textbox, in the first tab.

我遇到了同样的问题,发现我没有将项目名称放在第一个选项卡的项目文本框中。

回答by Marco Vargas

In my particular case I had a Maven Project Loaded into Eclipse Mars, and when I tried to run a specific main class, the project itself didn't appear in the Project List under:

在我的特殊情况下,我将 Maven 项目加载到 Eclipse Mars 中,当我尝试运行特定的主类时,该项目本身没有出现在以下项目列表中:

Configurations -> Java Application -> Project -> Browse...

配置 -> Java 应用程序 -> 项目 -> 浏览...

What I did was just to convert the Project to have Facets... in the Project Properties:

我所做的只是将项目转换为在项目属性中具有 Facets...:

Main Menu -> Project -> Properties -> Project Facets

主菜单 -> 项目 -> 属性 -> 项目构面

Once I did it, just selected Java and the version I needed and it started working.

一旦我这样做了,只需选择 Java 和我需要的版本,它就开始工作了。