Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling Only One Class in a Project

I have build automatically turned off and I want to build only one class (for debugging). Is this possible? Other classes are already compiled in the build directory, but they might not compile under Eclipse.

like image 804
IAdapter Avatar asked Nov 29 '11 14:11

IAdapter


People also ask

How many classes in a project should contain the method main?

In Java, you need to have a method named main in at least one class.

Can you only have one class per file in Java?

Each Java source file contains a single public class or interface. When private classes and interfaces are associated with a public class, you can put them in the same source file as the public class. The public class should be the first class or interface in the file.

How to compile single Java file in IntelliJ?

Compile a single file or classOpen the needed file in the editor and from the main menu, select Build | Recompile 'class name' ( Ctrl+Shift+F9 ). Alternatively, in the Project tool window, right-click the class you need and from the context menu, select Recompile 'class name'.


1 Answers

I think you can by going to the Project menu and selecting Build Working Set -> Select Working Set.

Select new, give your set a name then select only the single class you want to build. Once done it should build.

Next time you want to build, goto the Project menu and select Build Working Set -> and the name of the set you created.

like image 133
James Smith Avatar answered Sep 20 '22 08:09

James Smith