-1

I'm new to Java. I wrote some simple code that converts integer to binary. I want to test if the code works in the jshell_console so that i won't need a "main" every time.

At first, I forgot to use "public" when I declared the class in my source code, as well as its methods (for the conversion). So the jshell console reported error. But after I corrected the error and rebuilt the project, the console still failed. The weird thing is after I close and restart IntelliJ, the console finally works as expected...

Is it caused byIntelliJ's fault or me? And I wonder how I should recompile or rebuild the source code / project to make the console respond immediately without the need to restart IntelliJ.

Thank you for the attention!

CDawn
  • 13
  • 3

1 Answers1

0

While JShell console is opened IDEA doesn't recompile your code. So old code version was used until you restarted IDE. Next time you could just close console and run "Rebuild".

y.bedrov
  • 5,318
  • 3
  • 22
  • 19