简体   繁体   English

如何在IntelliJ中运行有错误的项目?

[英]How to run project with errors in IntelliJ?

It is possible to run a project, which contains errors in Eclipse . 可以运行一个项目,其中包含Eclipse中的错误。

I think it is normal for project with many files to contain some erroneous files to fix in the future and still be able to run it. 我认为包含许多文件的项目中包含一些错误的文件以在将来修复并仍然能够运行它是正常的。

Unfortunately, I can't find this possibility in IntelliJ . 不幸的是,我在IntelliJ找不到这种可能性。

Methods proposed in this answer IntelliJ Idea, run code regardless of errors in unrelated project files do not work for me. 此答案IntelliJ Idea中提出的方法,无论无关项目文件中的错误如何运行代码,对我来说都不起作用。

It throws ClassNotFoundException in the class with main. 它在main类中引发ClassNotFoundException Class itself contains no errors and was running under Eclipse. 类本身不包含任何错误,并且在Eclipse下运行。 There is no apparent appropriate *.class file in target/classes directory. target/classes目录中没有明显合适的*.class文件。

In your run configuration, you can tell it not to make before running. 在您的运行配置中,您可以告诉它在运行之前不进行配置。

You can compile individual files through their right-click menu or (from memory) Ctrl+Shift+F9 if the file you want to compile is in the editor. 您可以通过右键单击菜单或(从内存中)Ctrl + Shift + F9编译单个文件(如果要编译的文件位于编辑器中)。

A combination of these two will mostly achieve what you want, although this is probably the key paradigm difference between IntelliJ and Eclipse, and you'd be using IntelliJ in a sort of non-IntellliJ way (if you see what I mean). 尽管这可能是IntelliJ和Eclipse之间的关键范式差异,但这两者的组合将基本实现您想要的功能,并且您将以一种非IntellliJ的方式使用IntelliJ(如果您明白我的意思)。

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

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