简体   繁体   English

Eclipse程序未运行?

[英]Eclipse programs not running?

I am new to java . 我是java新手。 I have just got Eclipse working (somehow) lol. 我刚刚让Eclipse工作(以某种方式),哈哈。 well my programs are running fine until- 好吧,我的程序运行良好,直到-

I save a program, close out of eclipse, and re-open the program. 我保存了一个程序,关闭了日食,然后重新打开了该程序。 when I try to run it the same way that works for all the other programs, I am getting a message asking to "run with ant build". 当我尝试以适用于所有其他程序的方式运行它时,我收到一条消息,要求“使用ant build运行”。 for some reason eclipse will not run any of my programs that have been closed out and re-opened, but will run new programs just fine. 由于某种原因, eclipse不会运行我已关闭并重新打开的任何程序,但是可以运行新程序。

does anyone know how to fix this??? 有谁知道如何解决这一问题???

thanks 谢谢

EDIT- i would post an image, but I do not have at least 10 reputation.. what is happening is I go to open file => C:\\Documents and Settings\\xxxxxx\\workspace\\t\\src\\t (t is the program's name) and then I open it, and run it. 编辑-我会发布图像,但是我没有至少10个声誉。.发生的事是我打开file => C:\\Documents and Settings\\xxxxxx\\workspace\\t\\src\\t (t is the program's name) ,然后打开它并运行它。 When I run it (either F11 or the run button) it pops up a window saying "select what to run as", and the only options are 2 ant build icons. 当我运行它时(无论是F11还是运行按钮),它会弹出一个窗口,显示“选择运行方式”,唯一的选项是2个ant build图标。 Running as ant build does not work, because this isn't an antbuild file. 作为ant build运行不起作用,因为这不是antbuild文件。 I created a new program just to test, (from scratch) and everything compiles and runs fine... 我创建了一个新程序来进行测试,(从头开始),一切都可以编译并正常运行...

everything is compiling and running fine on NEW programs, but I just tried opening a program I created yesterday, and it is giving me the error mentioned above.. it was running perfectly fine yesterday. 一切都可以在新程序上编译并运行良好,但是我只是尝试打开昨天创建的程序,这给了我上面提到的错误..昨天运行得很好。 also, I have JDK installed at home, and I am getting this same exact problem.. JDK isn't the source. 另外,我在家中安装了JDK,并且遇到了同样的问题。.JDK并不是源代码。

EDIT- i have 10 rep now. 编辑-我现在有10名代表。 Here's an image of what was happening before the fix 这是修复之前发生的情况的图像

问题

" what is happening is I go to open file.." “发生了什么事我要打开文件。”

You don't want to open the file. 您不想打开文件。 You want to open the project 您要打开项目

  • Click on File menu 点击文件菜单
  • Click on import 点击导入
  • Click on General 点击常规
  • Select on Existing Projects into Workspace. 选择“将现有项目导入工作区”。 CLlick Next 单击下一步
  • Click Browse to search from your project 单击浏览从您的项目中搜索
  • Select the Project, Click OK 选择项目,单击确定
  • Click Finish 点击完成

The project should now show in your package explorer and you can then run it. 现在,该项目应显示在您的包资源管理器中,然后您可以运行它。

To run program JRE is enough. 要运行程序JRE就足够了。

If you want to build project you need JDK . 如果要构建项目,则需要JDK

Eclipse is a Java application and it works without JDK ,but it needs JDK to build a project. EclipseJava应用程序,不需要JDK就可以工作,但是它需要JDK来构建项目。 Eclipse is not compiler or something like that, it's only an IDE . Eclipse不是编译器或类似的东西,它只是一个IDE

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

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