简体   繁体   English

每当我碰到运行eclipse时,它都会给出先前运行程序的价值

[英]Whenever I hit run eclipse it gives value of previous run program

Earlier when i am creating a new class for practicing programs in Eclipse. 早些时候,我正在创建一个新类来在Eclipse中练习程序。 I use to create in same project and it used to run well. 我曾经在同一个项目中创建它,并且它过去运行良好。 But lately i have to specially go to Run>Run Configuration> I have to manually select the project and main class. 但是最近我必须专门去运行>运行配置>我必须手动选择项目和主类。

Is there any configuration im missing as this is time consuming to every time go and change the main class. 是否缺少任何配置,因为每次更改主类都会浪费时间。

Can anyone help? 有人可以帮忙吗?

You can press the black arrow near the Run button to select what to run, usually you will find your classes with public static void main(String[] args) there. 您可以按“运行”按钮附近的黑色箭头选择要运行的内容,通常您会在其中找到带有public static void main(String[] args) That's how it works for me. 这就是我的工作方式。

运行按钮

The problem can be due to new class files not being generated due to errors. 该问题可能是由于错误导致无法生成新的类文件所致。 I have seen the same results as you (new changes not picked up) due to one or both of the following. 由于以下一项或两项,我看到了与您相同的结果(未取得新更改)。

1) Look for red-! 1)寻找红色! or red-X next to a project and fix the problem(s) in that project. 或项目旁边的红色X并解决该项目中的问题。

在此处输入图片说明

2) Check the Problems tab and fix all red-X errors. 2)检查问题选项卡,并修复所有red-X错误。

在此处输入图片说明

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

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