简体   繁体   English

有没有办法删除Eclipse运行配置中的元数据?

[英]Is there a way to delete meta-data on Eclipse run configurations?

I may have a corruption problem in Eclipse run configurations. 我可能在Eclipse运行配置中存在损坏问题。 This happened after I dragged (or copy-pasted, I don't remember) a Java class called MyClass from project1 to project2 . 这是在我从project1拖动(或复制粘贴,我不记得)一个名为MyClass的Java类到project2 Then I deleted project1 . 然后我删除了project1 When I create a new run configuration the name given is MyClass (1) . 当我创建一个新的运行配置时,给出的名称是MyClass (1) In other words, it thinks there is already a run configuration called MyClass , so the new one will have to have a number appended. 换句话说,它认为已经存在一个名为MyClass的运行配置,因此新的配置必须附加一个数字。 ( Edit: There is no existing MyClass run configuration so there is no apparent reason for the appended number. In fact, I deleted all of my run configurations.) 编辑:没有现有的MyClass运行配置,因此附加数字没有明显的原因。实际上,我删除了所有运行配置。)

How can I easily clean up meta-data and be able to build again with minimal manual effort? 如何轻松清理元数据并以最少的手动工作再次构建?

If there is a meta-data deletion recommendation that gets rid of more than just run configurations, that probably would still be a good solution, if it does not create a lot of manual work to get set up to work again. 如果有一个元数据删除建议不仅仅是运行配置,那么这可能仍然是一个很好的解决方案,如果它没有创建大量的手动工作来设置再次工作。

Edit: The problem might be caused by the fact that there is a launch configuration named MyClass - project1 visible in the export dialogue. 编辑:问题可能是由于在导出对话框中有一个名为MyClass - project1的启动配置MyClass - project1可见。 project1 no longer exists, but this remnant lives on, tying up the class name MyClass . project1不再存在,但这个遗留物继续存在,将类名MyClass捆绑起来。 I am not sure if there is a difference between a run configuration and a launch configuration. 我不确定运行配置和启动配置之间是否存在差异。

AFAIK launch configurations are stored on: AFAIK启动配置存储在:

${WORKSPACE}/.metadata/.plugins/org.eclipse.debug.core/.launches

Take a look to the existent configurations and remove those that are not interesting to you. 查看现有配置并删除那些对您不感兴趣的配置。

And restart Eclipse 然后重启Eclipse

Open Eclipse. 打开Eclipse。 Follow Run => Run Configurations . 按照Run => Run Configurations运行 You will see options on the left hand side. 您将在左侧看到选项。 Under the Java Applications option, you will see the list of runnable classes (the ones have a main method). Java Applications选项下,您将看到可运行类的列表(具有main方法的类)。 These class nodes on that list are right clickable. 该列表上的这些类节点是可右键单击的。 By right clicking on your running configuration, you will see New , Duplicate and Delete options. 通过右键单击正在运行的配置,您将看到“ 新建” ,“ 重复”和“ 删除”选项。 You can delete your old running configuration via delete option. 您可以通过删除选项删除旧的运行配置。 To create a new running configuration, right click on Java Applications option and click on New and then configure it. 要创建新的运行配置,请右键单击Java Applications选项,然后单击New ,然后对其进行配置。

You could try starting eclipse with the -clean command line option . 您可以尝试使用-clean 命令行选项启动eclipse。

On windows the easiest way to do that is to copy your shortcut to eclipse and add the option to the arguments list, then start using the new shortcut. 在Windows上,最简单的方法是将快捷方式复制到eclipse并将选项添加到参数列表中,然后开始使用新的快捷方式。

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

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