Small problem to run any source code in Java

When creating any source code, as in the example below, and after clicking the button to execute, the result of the code execution does not appear, and instead always appears the phrase: "Built Successfully".

enter image description here

Not even clicking on F6 or Shift + F6 works.
Please, how do you go about showing the code result on the screen?

>Solution :

You probably have another class with a main method which is configured to run as the "main class"

Option #1

Make sure the source file is selected in the editor and use Shift+F6 to "Run file"

Option #2

Right click on the project node and select "Properties"

enter image description here

Navigate to "Build" > "Run" and verify the "Main Class" property

enter image description here

Click "Browse" (next to "Main Class") and select the class you want to act as the "Main Class"

enter image description here

Leave a Reply