0

I am new to IntelliJ, I started using it because it streamlines java coding stuff.

I am currently a student so my main java folder is not a complete project but a collection of different individual java programs like a program for testing ArrayList functionalities, or a specific leet code problem. I have one java folder and many different subfolders depending upon the content.

When I open my java folder with IntelliJ and run one of the files it tries to compile all the java files in the java folder, and I don't want it to do that. How do I configure IntelliJ such that it treats all files within my java folders as individual files and complies only the ones that I want to compile, like blueJ for example?

Note: I have searched for this question but found mostly outdated answers or answers that don't work in my case. I tried the current file option from the top right drop-down but it says class "xxxx" is never used or something like that and that the file is not runnable.

Guy Coder
  • 24,501
  • 8
  • 71
  • 136
  • Please see https://stackoverflow.com/a/16784855/104891. Does it help? – CrazyCoder Dec 07 '22 at 17:37
  • A suggestion, have different projects for different things. For work, we have one project per, er, well, project. However, for testing code that I find here on Stack Overflow or other code detective work, I have a project called `test-code` and inside there I have many different packages for different tests named after what the problem is about: forloop, lists, circuitbreaker, codepoint, md5, jackson, etc... – hooknc Dec 07 '22 at 17:49
  • You can use Scratch files feature as well: https://www.jetbrains.com/help/idea/scratches.html. – CrazyCoder Dec 07 '22 at 17:50
  • @hooknc , yeah, that is an excellent way in the future, but it does not solve my current problem, which is I have a lot of code in that folder that I wrote in BlueJ for testing, and I want a way to compile them individually as I can do in BlueJ. – Rohith Rathod Dec 08 '22 at 00:57
  • @CrazyCoder , the StackOverflow link you posted doesn't help as I should do it for every java file in my folder, which is very tedious. The scratch file idea, for some reason, is not working as it still says in the problem window that class "xxxxx" is never used and method "xxxx" is never used. – Rohith Rathod Dec 08 '22 at 01:07

0 Answers0