Please Help! Intellij is not running the class I try to run if there is an error in another class in the whole project?

已回答

Hi, I'm new to Java programming and so far I can say I liked using Intellij since it is an user friendly IDE with useful shortcuts. The problem is, I created two classes lets say one of them is FirstClass and the other one is SecondClass. Firstclass is running succesfully but after then I had a compiler error while working on SecondClass. While there is an error on SecondClass, I cannot run FirstClass because it automatically goes and keeps telling me there s an error. Isn't there a way to make Intellij run regardless the errors from other classes? Please help, I dont want to use another IDE just because of such situation.

评论操作 固定链接

Could you please share your project with us? You can upload an archive using the JetBrains Uploads service and write here an ID you receive.

1
评论操作 固定链接

In the screenshot I uploaded above there are two classed made by me. Actually both of them are working now but when I had this issue, SecondClass.java was not working because I made something which led a compiler error. Now in SecondClass.java I did not close a curly bracket just to make an error on purpose(to see IDE wont let me run other class which runs without any problem). My problem is why IntelliJ compiles Whole project and see if there is a mistake in other classes? I cannot run FirstClass.java without fixing the problem in SecondClass.java because compiler checks the whole project first to make sure if there is an error, not the class which is currently on the screen. Isn't there a setting to turn off this? 

0
评论操作 固定链接

Please, check this article in our documentation regarding the Build action. Shortly, when you use this action, IntelliJIDEA compiles all classes. To compile a single file or class, you can use the Build | Recompile 'class name' action.

0

请先登录再写评论。